Searching \ for '[EE] windows cmd line apps' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'windows cmd line apps'.

Exact match. Not showing close matches.
PICList Thread
'[EE] windows cmd line apps'
2007\01\21@005229 by Steve Ravet

The last time I did any windows GUI programming was with Petzold's book
in hand, before there were any class libraries or anything like that.
I'm rewriting a simple C++ GUI application as a cmd line app and it
works except for one thing.  The GUI version registers for callbacks
anytime there's a USB event, such as a connect or disconnect.  This is
done via the API routine RegisterDeviceNotification(), which results in
device messages being added to a windows message queue.  cmd line apps
don't have windows or message queues, does anyone know what the
equivalent functionality would be for a cmd line app?


Steve Ravet

2007\01\21@020512 by PICLIST

>From looking at the Windows API, you must create a windows procedure so you can
receive the messages you are looking for. The only other alternative appears to
be to run as a service, which is probably not what you want as services are not
really allowed to communicate with the user.

Console apps are allowed to register a window class and create a windows message
loop. You need to link it as a console app so the system will attach you to the
console from which you are started. If you link as a GUI, there is no good way
to get a console window. From there you should be able register for and get the
messages you are looking for. It might be a good idea to create a separate
thread that creates the message loop and processes the device notification

Go back to your Petzold book and copy/paste the basic windows class registration
and message loop code as a starting point for your message thread.

Hope this helps.

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...