Autosleep kills focus?

  • Thread starter Thread starter chook.harel
  • Start date Start date
C

chook.harel

Hi, my terminal has an autosleep function,
that shuts down the screen (and my guesses: standby to memory)
and when i click power on, I see my program for a second
but then it sort of minimizes, and i'm back at the welcome screen
(PPC2003SE)

any idea folks?
 
Hi,
Try out following:

' API Declaration
Declare Function FindWindow Lib "CoreDll.dll" (ByVal className() As
Char, ByVal WindowsName() As Char) As Integer
Declare Function SetForegroundWindow Lib "CoreDll.dll" (ByVal hWnd As
Integer) As Boolean

' Function to make the window topmost
Private Function SetWindow(ByVal WindowName As String) As Boolean
Dim hWnd As Integer
hWnd = FindWindow(Nothing, WindowName.ToCharArray())
If hWnd <> 0 Then
SetForegroundWindow(hWnd)
Return True
Else
Return False
End If
End Function

Use this function with a timer and just pass title of the form in your
application which should be on top.

Regards,
Bipin Kesharwani
(Developer)
Palewar Techno Solutions
Pocket PC & Mobile Software Development
Nagpur, India

http://www.palewar.com
 
The timer, meaning it will count endlessly?
Anyway thanks alot! i'll try the procedure
 
Hi,
I just gave an example of timer, you can detect "Power On" status
using API's also, this will make your app on top as soon as you click
power on (wake up)

Regards,
Bipin Kesharwani
(Developer)

Palewar Techno Solutions
Pocket PC & Mobile Software Development
Nagpur, India

http://www.palewar.com
 
Back
Top