473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

last API question....

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)

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
Jul 25 '06 #1
4 834
"iwdu15" <jmmgoalsteratyahoodotcomschrieb:
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)
I suggest to post the function declarations you are using.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jul 25 '06 #2
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
Jul 25 '06 #3
"iwdu15" <jmmgoalsteratyahoodotcomschrieb:
Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal
hWnd As IntPtr, ByVal nCmdShow As Long) As Long
Your declaration was wrong. Here's the corrected version:

\\\
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/>

Jul 25 '06 #4
awsome, that works.....thanks a ton for all your help
--
-iwdu15
Jul 25 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Dennis Marks | last post by:
There seems to be a major program with the automatic display of the last modified date. Using the javascript "document.lastModified" sometimes returns the correct date and sometimes 1 Jan 1970...
2
by: Les Juby | last post by:
Hi A clint has insisted we load a babbling brook sound clip to his home page but it needs to load last to avoid delays in loading images and other elements. Simply declaring it at page bottom...
20
by: Guru | last post by:
Hi I have a table which contains number of rows. I want to fetch the last 5 records from the table. I know for the first 'n' records we can use FETCH FIRST n ROWS ONLY command. But i want to...
0
by: FAQPoster | last post by:
An HTML version of this document is available at: http://www.mvps.org/access/netiquette.htm Feeling left out? Alone? Wondering why everyone's ignoring you? Or why you're being flamed for what...
10
by: MaRCeLO PeReiRA | last post by:
Hi guys, I am in troubles with a SERIAL field. I have five tables. A parent table and four child tables. When I do the INSERT in the parent table, I have an ID (generated) by the sequence...
6
by: Christo | last post by:
I have this script for showing news on a page, but i want it to only show the last 10 records, as in the 10 records that were added to the database last. the script shows the entries in descending...
1
by: Kimmo Laine | last post by:
Hi! I need to resize the last column in my listview control so that there won´t be horizontal scrollbar. Lets first create lv and add some items: listView1.View = View.Details;
4
by: Rasputin | last post by:
Hello, The topic of this question is somewhat related to my previous question, but I wasn't sure if it diserved its own thread. In case of doubt... I double threated. If it's not OK let me...
12
by: foolsmart2005 | last post by:
There are 10 webpages on the host, e.g. 001.html, 002.html, 003,html, 004.html, ......010.html I want to check whether the page is the last page. How can I do. In the index.html -Go to last...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.