hi everyone, i'm really new to C so please bear with me here. i am trying to make a simple app where you click on the form/main page and an external application is launched (let's call this C:\1.exe). when you double click, another application is launched (C:\2.exe). and finally when you right click, a third application (C:\3.exe) is launched. how is it possible to do this? i hope this is not too complicated. thanks in advance.
1. Create message handlers for WM_LBUTTONDOWN (or WM_LBUTTONUP), WM_LBUTTONDBLCLK, WM_RBUTTONDOWN (or WM_RBUTTONUP).
2. Use ::CreateProcess API to launch external programs.
When you get on to building more complex applications with context menus, you'll want to handle WM_CONTEXTMENU rather than WM_RBUTTONDOWN.
The reason is you can display a context menu with the SHIFT + F10 keyboard command. If you only handle a WM_RBUTTONDOWN, the context menu can't be invoked from the keyboard.
If you use WM_CONTEXTMENU, it will work for the right mouse click and keyboard.
[QUOTE=VictorN;2025343]1. Create message handlers...QUOTE]
Hi Victor thanks for using message handlers instead of events handlers.
It makes things much easier to comprehend.
There are only 10 types of people in the world: Those who understand binary and those who do not.
Bookmarks