INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [Problem] Plugin doesn't reviece windows messages after focus switched  (Read 1702 times)

Jeronimo

  • Recent member
  • *
  • Posts: 14
  • Suicide's an easy solution...I like easy solutions

Hello everybody.

I'm developing a global hotkey plugin in C#, which works when outside MJ12 (Control in a Form) but has a small problem. Whenever I change the focus in MJ e.g to Playing Now, Audio or somewhere else the plugin is disposed :-( I need the context though, so that the plugin doesn't need to have focus to function.
 How is this accomplished ?

Thank you !
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71432
  • Where did I put my teeth?
Re: [Problem] Plugin disposed after focus switched
« Reply #1 on: February 01, 2010, 07:13:30 am »

disposed may not be the right word.
Logged

Jeronimo

  • Recent member
  • *
  • Posts: 14
  • Suicide's an easy solution...I like easy solutions
Re: [Problem] Plugin disposed after focus switched
« Reply #2 on: February 02, 2010, 02:08:07 am »

Yeah you're right it isn't. The control just isn't visible anymore.

Well anyway evertime the control is opened it isn't just made visible. It recreated but that isn't a (big) problem anymore cuz I saved the hotkeys in a file.

 My problem now is the control doesn't recieve any WM_HOTKEY messages anymore. I hope this is not basic knowledge concerning controls but when it isn't visible no WH_*** messages are recieved in the WinProc :-( Is this normal behaviour ?

 If this is normal behaviour is there some kind of design pattern or algorithm that is used ?

Thanx
Logged

Jeronimo

  • Recent member
  • *
  • Posts: 14
  • Suicide's an easy solution...I like easy solutions
Re: [Problem] Plugin doesn't reviece windows messages after focus switched
« Reply #4 on: February 02, 2010, 12:33:32 pm »

I was hoping you wouldn't say that :-( Not that it would be hard to do, but because the WM_HOTKEY message is there for a reason and a global hook would just be a workaround and not an actual solution. :-\

I'm also thinking about creating an invisible form, which would call the usercontrol's function...that'd be a very ugly solution. Aw man :-(

Thanks for hint Messiahs.

Edit: I just noticed I posted in the wrong forum. Mods please move the post if you feel like it.
Edit2: Does anybody know why the control doesn't receive any windows messages when invisible ?
Logged
Pages: [1]   Go Up