Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32058

Convert VB Code to C#

$
0
0
Hello Friends,
                             I have tried all converters but they don't work.Can anyone please convert following code to c#.Thanks in advance.

Dim hwnd1 As Long


Private Declare Function SetWindowPos Lib "user32" _
       (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As _
       Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags _
       As Long) As Long

Private Declare Function FindWindow Lib "user32" _
       Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName _
       As String) As Long

Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40

Private Sub Command1_Click()
 hwnd1 = FindWindow("Shell_traywnd", "")
 Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub

Private Sub Command2_Click()
 Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub

Viewing all articles
Browse latest Browse all 32058

Trending Articles