|
|
#1 |
|
Junior Member
Join Date: Nov 2008
Posts: 7
|
catch minimize of main window
does anyone know how i can execute an action whenever winamp is minimized? my c++ is shit and i can't seem to find a single example of how to receive this kind of a message from the window
there are examples of the reverse -- say to minimize the window. but i want to know when the user minimizes the window, so that i can execute a particular function, and then when winamp is restored, to execute another function. specifically, i am hoping to have a gen_plugin that loads a different visualizer when winamp is off the screen (keyboard_led_flasher) and then fires up the spectrum analyzer again when back on screen i've tried loops and switches with IPC_ISWNDVISIBLE but then winamp hangs while the loops wait for focus... maybe there is a way to use windows messages like WM_ACTIVATEAPP, but could anyone help me figure out how to do it so that winamp doesnt hang?? i was working inside init() but its my first plugin for winamp i really have no idea whats what appreciate any help cheers m8s
|
|
|
|
|
|
#2 |
|
Forum King
|
If you want to poll the main window's state you would either need to do it by checking it from a timer message/function or by doing it with an intermittently sleeping thread. However I would not go polling (especially in a loop called from the context of the main UI thread) if I didn't need to.
You can either subclass the main window or hook the main window and then look for one, some, or all of the following messages: WM_SIZE WM_SYSCOMMAND |
|
|
|
|
|
#3 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,481
|
using a hook would be the only safe way to do it with the scenario presented of this being for a visualisation plug-in.
-daz |
|
|
|
|
|
#4 |
|
Forum King
|
Oops, hah, nice catch DrO. Forgot about that.
|
|
|
|
![]() |
|
|||||||
| Tags |
| listen, minimize, visualizer plugin |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|