Changing The Windows Class Name.

  • Thread starter Thread starter Marauderz
  • Start date Start date
M

Marauderz

Does anyone have any idea how to change the MessageWindow's class name, so I
can use it with APIs that target a specific Classname?

Thanks.
 
You can't change the classname since this is set when the native window is
created. You can change the caption of the messagewindow so that you can use
FindWindow to locate your messagewindow. You can do this by P/Invoking
SetWindowText e.g.

[C#]
[DllImport("coredll.dll")]
private static extern bool SetWindowText(IntPtr hwnd, string text);
[VB]

Private Declare Function SetWindowText Lib "coredll.dll" (ByVal hwnd As
IntPtr, ByVal text As String) As Boolean



Peter
 
Well I'm trying to use the wakeup feature of the WDP API, but it seems like
on the smartphone it doesn't work too well. The only other way I can see
from the docs is that the system will wake up an app and pass a message to a
specific Window Class, so I'm pretty much screwed ain't I?


Peter Foot said:
You can't change the classname since this is set when the native window is
created. You can change the caption of the messagewindow so that you can
use FindWindow to locate your messagewindow. You can do this by P/Invoking
SetWindowText e.g.

[C#]
[DllImport("coredll.dll")]
private static extern bool SetWindowText(IntPtr hwnd, string text);
[VB]

Private Declare Function SetWindowText Lib "coredll.dll" (ByVal hwnd As
IntPtr, ByVal text As String) As Boolean



Peter


--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org



Marauderz said:
Does anyone have any idea how to change the MessageWindow's class name,
so I can use it with APIs that target a specific Classname?

Thanks.
 
Thats a tricky one, since you could set "#NETCF_AGL_MSG_" in the registry,
but this might cause problems if another app is running which uses a
messagewindow. If you turn off the notifyonlaunch setting (set it to 0) then
the system will launch your app but not send it any messages. this may be
acceptable if you know the port you need to open.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Marauderz said:
Well I'm trying to use the wakeup feature of the WDP API, but it seems
like on the smartphone it doesn't work too well. The only other way I can
see from the docs is that the system will wake up an app and pass a
message to a specific Window Class, so I'm pretty much screwed ain't I?


Peter Foot said:
You can't change the classname since this is set when the native window
is created. You can change the caption of the messagewindow so that you
can use FindWindow to locate your messagewindow. You can do this by
P/Invoking SetWindowText e.g.

[C#]
[DllImport("coredll.dll")]
private static extern bool SetWindowText(IntPtr hwnd, string text);
[VB]

Private Declare Function SetWindowText Lib "coredll.dll" (ByVal hwnd As
IntPtr, ByVal text As String) As Boolean



Peter


--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org



Marauderz said:
Does anyone have any idea how to change the MessageWindow's class name,
so I can use it with APIs that target a specific Classname?

Thanks.
 
I know the port I need to open on the pocket PC, and single SMS WDP packets
the code works flawlessly.

But, it would seem that on a smartphone unless the applkication was already
running previously and have the WAP handled already opend in the first place
it just doesn't seem to be able to get the packets.

Peter Foot said:
Thats a tricky one, since you could set "#NETCF_AGL_MSG_" in the registry,
but this might cause problems if another app is running which uses a
messagewindow. If you turn off the notifyonlaunch setting (set it to 0)
then the system will launch your app but not send it any messages. this
may be acceptable if you know the port you need to open.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Marauderz said:
Well I'm trying to use the wakeup feature of the WDP API, but it seems
like on the smartphone it doesn't work too well. The only other way I can
see from the docs is that the system will wake up an app and pass a
message to a specific Window Class, so I'm pretty much screwed ain't I?


Peter Foot said:
You can't change the classname since this is set when the native window
is created. You can change the caption of the messagewindow so that you
can use FindWindow to locate your messagewindow. You can do this by
P/Invoking SetWindowText e.g.

[C#]
[DllImport("coredll.dll")]
private static extern bool SetWindowText(IntPtr hwnd, string text);
[VB]

Private Declare Function SetWindowText Lib "coredll.dll" (ByVal hwnd As
IntPtr, ByVal text As String) As Boolean



Peter


--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org



Does anyone have any idea how to change the MessageWindow's class name,
so I can use it with APIs that target a specific Classname?

Thanks.
 
Back
Top