|
||||
Quote:
If I can clean my code up a bit, I'll post it on the ftp, but for now it's sloppy as heck, hehe. Basically the module looks like this... Code:
Public running As Boolean Public old_height = Screen.PrimaryScreen.Bounds.Height Private Declare Sub sapiSleep Lib "coredll" Alias "Sleep" (ByVal dwMilliseconds As Long) Public Sub sSleep(ByVal lngMilliSec As Long) If lngMilliSec > 0 Then Call sapiSleep(lngMilliSec) End If End Sub Public Sub Main(ByVal cmdArgs() As String) running = True Registry.SetValue(regKey, "Running", True) Do While running = True If Screen.PrimaryScreen.Bounds.Height <> old_height And old_height = 240 Then old_height = Screen.PrimaryScreen.Bounds.Height If playSounds Then playIn() If RunApps Then launchapp(slideInApp, "In") ElseIf Screen.PrimaryScreen.Bounds.Height <> old_height And old_height = 320 Then old_height = Screen.PrimaryScreen.Bounds.Height If playSounds Then playOut() If RunApps Then launchapp(slideOutApp, "Out") End If sSleep(250) running = Registry.GetValue(regKey, "Running", False) If running = False Then Exit Sub slideInApp = Registry.GetValue(regKey, "SlideInApp", "\Windows\calc.exe") slideOutApp = Registry.GetValue(regKey, "SlideOutApp", "\Windows\calc.exe") playSounds = Registry.GetValue(regKey, "PlaySounds", True) RunApps = Registry.GetValue(regKey, "RunApps", False) Application.DoEvents() Loop End Sub
__________________
Projects: (SlideSound) (Personal OEMizer (1.4.0 )) (TDial Designer (v1.1.1 )) (TierAutoinstall (1.9)) and more...
HTC Sliding Sound Control Panel replacement. | SprintTV on Mogul? Donations appreciated |
|
||||
Ugh. You need to change it to be event driven. Polling should have died with VB6.
__________________
Grammar: The difference between knowing your shit and knowing you're shit.
|
|
||||
I've been researching this for several hours now, but there is very limited documentation that I've been able to come across. What I'm trying to find out is just how and where the physical act of sliding the keyboard out triggers the screen rotation. Does anyone know if its linked to a hardware button?
If i can find that button i can hook into it, if not I've been looking into writing a Today Screen plugin, which would allow me (i think) even greater flexibility. I only really want the messaging app to appear if I'm on the today screen, if I'm in my email wanting to reply its a bit of a pain. If i can write the plugin to just sit there invisible, i think you would have to be on the today screen for the ScreenOrientation event to be raised. If so i can attempt to go as far as disable the today screen while in landscape mode, thus saving the time to render it before opening the messaging app and instantly pop up my messaging. Sound feasible to anyone? Tips appreciated, as well as good sites with sample code/forums for cf2 vb net or c# programming. |
|
||||
http://www.freevbcode.com/ShowCode.asp?ID=4042
If that's possible using coredll you'd be able to output the keypresses to a textbox and see what the value is for the slide function. I'm going to mess around a bit. |
|
||||
That's unlikely to produce anything, as it is designed to tell you about key states that, when passed to the keytranslator, results in a keycode. Try this: Microsoft.WindowsMobile.Status namespace
|
|
||||
Thanks, gguruusa
That helps a lot. I'm going to try this out tonight and see if I can convert most of what I have. Edit: This is much nicer. It's working like it did before but it's actually using the event (SystemProperty.DisplayRotation) instead of pooling from that loop. I'll see what I can come up with for tomorrow. Thanks again. Edit: The problem I'm running into now (with the launched application not staying in foreground) seems to be that the OS is setting the last foreground application (from the previous screen orientation) as foreground after the screen update completes so it negates my foreground setting. I would have to wait until after the redraw to set the launched app to foreground. |
|
|
|