|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
last API question....today....last one (besides my one about adding a Menu Item to the system menu for all processes....) I have the handle of a window, i get the icon, hide the window by using ShowWindow(HandleHere, SW_HIDE) and it hides the window, then i add its icon to the system tray. now (i already added a handler for the notifyicon double click event) i want to restore the window when its double-clicked. ive attempted ShowWindow(HandleHere, SW_SHOW) but that didnt work, neither did ShowWindow(HandleHere, SW_SHOWMAXIMIZED) nothing ive tried has worked....OpenIcon() hasnt worked either.....how can i restore the window? thanks -- -iwdu15 "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: I suggest to post the function declarations you are using.> ok, thanks for all you who have put up with all my API questions > today....last one (besides my one about adding a Menu Item to the system > menu > for all processes....) > > I have the handle of a window, i get the icon, hide the window by using > > ShowWindow(HandleHere, SW_HIDE) -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> sure, sorry, forgot to do that....
Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hWnd As IntPtr, ByVal nCmdShow As Long) As Long Const SW_HIDE As Integer = 0 Const SW_SHOWNORMAL As Integer = 1 Const SW_NORMAL As Integer = 1 Const SW_SHOWMINIMIZED As Integer = 2 Const SW_SHOWMAXIMIZED As Integer = 3 Const SW_MAXIMIZE As Integer = 3 Const SW_SHOWNOACTIVATE As Integer = 4 Const SW_SHOW As Integer = 5 Const SW_MINIMIZE As Integer = 6 Const SW_SHOWMINNOACTIVE As Integer = 7 Const SW_SHOWNA As Integer = 8 Const SW_RESTORE As Integer = 9 Const SW_SHOWDEFAULT As Integer = 10 Const SW_FORCEMINIMIZE As Integer = 11 Const SW_MAX As Integer = 11 then i tried this too Dim x As New IntPtr(CInt(tray.Text)) ShowWindow(x.ToInt32, SW_SHOW) thanks a ton for your help -- -iwdu15 "iwdu15" <jmmgoalsteratyahoodotcom> schrieb: Your declaration was wrong. Here's the corrected version:> Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal > hWnd As IntPtr, ByVal nCmdShow As Long) As Long \\\ Private Declare Function ShowWindow Lib "user32.dll" ( _ ByVal hWnd As IntPtr, _ ByVal nCmdShow As Int32 _ ) As Boolean /// When asking questions about p/invoke, always inclide the declarations you are using because often declarations are incorrect and lead to problems. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
How do I handle this
RegEx Either Or Newbie question - VB.net, referencing controls Question: arraylist and item Discrepancy in DataGridView column order & databound DataTable Icon.FromHandle(..) not working? Lauch VB.NET App From Network Drive Or Network Share. how to hardcode lots of text into a textbox/RichTextbox? Need help/advice to make a decision Any way to pass an optional array? |
|||||||||||||||||||||||