Help with Excel and WinApi

M

MovieFan

Hi All,

I need to accomplish the following tasks. Any help in what direction
to proceed with really be appreciated. Note: This needs to be done
thorough VBA in Excel only!!!1

1) Need to know the list of windows (tasks) running
2) Display the window handle, class and title in a list box
3) Select a list item and double click should activate / maximize the
window
4) Be able to send a message to the window

Will look forward to your responses.

Thanks and Regards
 
C

Chirag

1) Use EnumWindows() WinApi call.
2) EnumWindows() will provide you with the window handle, use GetClassName()
for class and GetWindowText() for the title and fill it in a text box.
3) Write list box's double-click handler and use SetForegroundWindow()
WinApi in it.
4) Use SendMessage() to send message to the window.

- Chirag

Shortcut Manager - Assign keyboard shortcuts to PowerPoint menu items and
macros
http://officeone.mvps.org/ppsctmgr/ppsctmgr.html
 
M

MovieFan

1) Use EnumWindows() WinApi call.
2) EnumWindows() will provide you with the window handle, use GetClassName()
for class and GetWindowText() for the title and fill it in a text box.
3) Write list box's double-click handler and use SetForegroundWindow()
WinApi in it.
4) Use SendMessage() to send message to the window.

- Chirag

Shortcut Manager - Assign keyboard shortcuts to PowerPoint menu items and
macros
http://officeone.mvps.org/ppsctmgr/ppsctmgr.html










- Show quoted text -

Hi Chirag,

Thanks for the pointer. Could you provide me with the specific code
that I need to use. I am a newbie in WinApi programming under VBA so
some starters will be appreciated.

Meanwhile I'll also try to get something around in the lines you have
mentioned above.

Thanks again for the help.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top