Need a lot of help with my app! - Windows Mobile Development and Hacking General

Hey guys
I'm creating a Windows mobile 6.1 application and now i need a code that activates the backlight camera just by a buttonpress. Anybody that can help me, maybe supply me with a little exe or a code sample? I'm writing in C#...
Second, I wonder how to execute a command when the user of my application presses the X button in the right corner of the 6.1 system. I want a dialog popup menu to show and ask the user to quit or no. Hopefully you'll understand what i mean.
And last, i want to "disable" the visual keyboard icon shown between the mainmenu lists... i don't want it to show, if you get what i mean
Best regards

None of the currently 8000 peoples that can help me??

well, when I programmed some software with Object Pascal for WinMo 6.5 I spent hours trying to find some code to hide the keyboard icon, but I never solved the problem... But the icon depends on the program the application is started from. That means if you start it from File Explorer it is shown in the middle, if you start it from Total Commader it is shown in the lower left corner and if you start it from the start menu (shourtcut) it is hidden.
Maybe this is the same in C#...

Related

Simulate touchscreen tap, or add ShortCut key.

Hello,
I have such a problem. But first I will explain why I have that problem.
In company we are using a PocketPC with Windows Mobile 2002. And have only one apllication for work.
When connecting to Server we need to tap the left bottom corner of the screen.
Many of workers tap with diferent objects like cutters, pens, not with Stylus, so the left bottom corner become bad in 1-2 months, till the time I can't do nothing, just changing the screen.
So. There is a posibility to implement somehow a ShortCut to that menu, to avoid taping that part of screen? (Because after that in program we use only buttons.)
(Note: I have no source code for tha app.)
Any kind of help will be apreciate.
Thank you much!
It's easy to simulate screen tap by code.
Do you have experience programming in C/C++?
If so all you have to do is write a little app that does the following:
Code:
HWND hWnd; //window handle
hWnd = FindWindow(L"BUTTON", L"Connect to server"); //this text is just an example
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); //actually simulates the click
Then you can assign this app to a hardware button using device settings or put a shortcut to is in the start menu.
I don't know of any ready apps to just simulate a click, but there was a thread around here somewhere on a virtual mouse app for PPC. It's free so try searching for that. (Sorry, don't remember the link).
Good luck.
Thank you man.
I'll try this...
levenum said:
It's easy to simulate screen tap by code.
Do you have experience programming in C/C++?
If so all you have to do is write a little app that does the following:
Code:
HWND hWnd; //window handle
hWnd = FindWindow(L"BUTTON", L"Connect to server"); //this text is just an example
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); //actually simulates the click
Then you can assign this app to a hardware button using device settings or put a shortcut to is in the start menu.
I don't know of any ready apps to just simulate a click, but there was a thread around here somewhere on a virtual mouse app for PPC. It's free so try searching for that. (Sorry, don't remember the link).
Good luck.
Click to expand...
Click to collapse
So I have not so many experience in C++ and nor in Visual Studio.
Can you provide me with full c++ code for Visual Studio 2005?
Thank you in advance.
Here is another way. Just create a simple project in vis studio ( I am not using 2005 so I cant tell you what its called, if all else failes use the "hello world" option). Open the main .cpp file and after the includes delete everything. Paste this in....
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
return 0;
}
Then build the exe. Make a shortcut to the exe on your device and place it in the windows\start menu folder. When the user taps the shortcut the cordinates specified will get a mouse down message, not all ppc programs will rspond to this message but most bought software I have do.
As it is, this will hit the close button on a 240*320 display. To vary the target location see this from the documentation:
If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
...So you may need to play with it to hit the spot.
If that fails then just replace the
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
with levenum's code putting the name of the window you are talking about in instead of "Connect to server" to send the normal WM_LBUTTONDOWN message to that window.
OdeeanRDeathshead, your method seems to work. I did it and application works proprely on my Magician.
But now the question is: I need that program for a PocketPC 2002 platform. How to do this in VS2005, can explain me anyone?
Thank you in advance.
Actually, you can't write apps for WM2002 using VS2005.
You need eMbedded Visual C++ 3. It is available free from Microsoft, just search the site. You will also need to install Pocket PC 2002 SDK. (also free on MS site)
levenum said:
Actually, you can't write apps for WM2002 using VS2005.
You need eMbedded Visual C++ 3. It is available free from Microsoft, just search the site. You will also need to install Pocket PC 2002 SDK. (also free on MS site)
Click to expand...
Click to collapse
Ok.. all this I installed.
I will try to do the program there. But problem become more complicated.
My PDA's are not HTC. They are modified by SYMBOL company. So.. I realized that i have no HARD BUTTON.
In start menu I can't let the application, only because START is not accessible. The only program is that for work and it's full screen.
The PDA have a keyboard.
The question is: it is possible to do in program a HOT_KEY combination, and run MOUSEEVENTF_LEFTDOWN only when HOT_KEY combination was pressed.
I understand that program must remain in memory to intercept that.
Do you mean that there are no buttons on your device, only a keyboard?
Doesn't matter really because as far as windows is concerned keystrokes from device buttons and full keyboard are handled the same.
Sorry I am not really familiar with setting up hot keys, I think your app window needs to have input focus for that to work.
There is a function called SetWindowsHookEx that lets you hook all keyboard events so they will pass through your function. You can then have a small app in background (without UI) that will monitor any key combination you want and simulate the tap when necessary.
levenum said:
Do you mean that there are no buttons on your device, only a keyboard?
Click to expand...
Click to collapse
Yeah.... it looks like this http://www.symbol.com/PDT8100
I do not know if you can throw some cash at your problem but SKScHeMa from www.s-k-tools.com can wait for an application to start then execute a script. In the script you can simulate both tap and tap and hold actions.
Hope that helps.
Regards cjb.
One of those buttons must correspond to the buttons on the normal ppc. It would be overkill too write an app to run constantly just to redirect one tap. Do you have the opportunity to ever start the unit without the fullscreen program running, if so you could experiment with the button assignments to find the correct one. If the author of the custom software on the thing was half good they could have disabled those buttons assignments while its running, but if they didn't thats the best solution.
If that fails perhaps a program to run after powerup and ask if the user wants to connect to the server could work. It could show for 10 seconds then end. There was a thread here somewhere about programs starting on powerup but I can't seem to find it now.
edit:
I read the specs and it has two "side scan keys", I bet they are your buttons waiting to be reassigned!
OdeeanRDeathshead said:
One of those buttons must correspond to the buttons on the normal ppc. It would be overkill too write an app to run constantly just to redirect one tap. Do you have the opportunity to ever start the unit without the fullscreen program running, if so you could experiment with the button assignments to find the correct one.
Click to expand...
Click to collapse
No one of that buttons corespond to CALENDAR or CONTACTS or CAMERA or RECORD button.
I can start the device without work program. Also I don't need to simulate tap, because I own my PDA and have knoweledge how to use it.
Users don't know much... for that i disables all. Only Work program in fullscreen mode without START MENU.
I read the specs and it has two "side scan keys", I bet they are your buttons waiting to be reassigned!
Click to expand...
Click to collapse
This is a PDA with barcode scanner. That 2 buttons named "side scan keys" are only for SCANNER and are not programable.
TO ALL: Thank you for your support![/quote]
cjb said:
I do not know if you can throw some cash at your problem but SKScHeMa from www.s-k-tools.com can wait for an application to start then execute a script. In the script you can simulate both tap and tap and hold actions.
Hope that helps.
Regards cjb.
Click to expand...
Click to collapse
Thanks for help.
I can't do any investitions in that.
More of that it's not the same I need. I need to simulate this not only at start, also during work.
Yes, so make the prgram asking if a connect is needed run when the power button is pressed. If the user needs to connect they press off then on then the window comes up asking if a simulated tap is needed (I do not mean reset). If the full off is not desireable then dose your unit change the brightness when the power button is held down? If so, and if it is using the standard name for the named event to signal brigtness changes then you could make the tap simulate program run all the time in a loop but waiting for the brigtness change event. Waiting will take up almost no processor time and the program is so small it takes up almost no memory! The user just has to hold the power button for several seconds and the your window will pop up. The down side is that your app will also have to save then restore the brigtness settings so the user dose not need to manualy reset the brigtness level.

{SOLVED} Hide to system tray

Spent most of the evening searching various forums/newgroups before giving up and asking for help on this one.
Has anyone managed to work out how you can minimise your application to the system tray icon?
I had hoped this thread ( http://forum.xda-developers.com/showthread.php?t=274918&highlight=tray ) would reveal the secret, but whilst it does 'hide' my application, no icon is shown on the system tray for me to reactivate.
Would really appreciate some help on this.
Using VS2005, phone is Artemis and got the latest SDK for Mobile 5.
i am pretty sure i saw that effect once, on wm03. but what could that be....
upd: ehh damn i read your link..
how to remove my post...?
I take it you are using C# / VB.NET?
Not sure how to implement the solution in those, I only know C++.
There is no 'minimize to tray' function in windows - mobile or otherwise. The effect is achieved by two operations:
1) Hide your program window.
2) Create a notification icon in the tray using Shell_NotifyIcon API.
You can find full documentation about it in MSDN or VS help files.
Thank Levenum, the "Shell_NotifyIcon" call seems to work brilliantly.
Thanks again for the pointer, appreciated.
I'm a noob
levenum said:
I take it you are using C# / VB.NET?
Not sure how to implement the solution in those, I only know C++.
There is no 'minimize to tray' function in windows - mobile or otherwise. The effect is achieved by two operations:
1) Hide your program window.
2) Create a notification icon in the tray using Shell_NotifyIcon API.
You can find full documentation about it in MSDN or VS help files.
Click to expand...
Click to collapse
I don't have a single clue how to achive this, I want to hidem my tray bar on my deviece but I can't, I have not Idea what the Shell_NotifyIcon API is and I don't know how to hide my program window.
~J~: Glad I could help
fnordelus: I am not quite clear on what you want to do:
Do you want to get rid of the tray (the little icons at the bottom of your today screen) so you would have more room for plugins?
If that is the case then you just need to delete some shortcuts from windows\startup - but be careful! Some stuff in there you will need. If you tell us what device you are using and what shortcuts you have in that folder we can tell you what to delete and what not.
If you are writing a program and want to minimize your window to tray (put an icon in the tray when your window is not shown) then the first thing you must do is tell us what language you are using. If you do not know how to hide a window in your own program it is to early for this kind of tricks. You need to get a good book on Win32 programming and read it fisrt.

Kiosk mode & some questions

Hi,
my application on Windows Mobile 5.0 shall run in kiosk mode. Therefore, I've disabled the TaskBar and did some other stuff. Basically, it works great, but I'm still having a few problems:
1. When I hide the taskbar, also the "OK" Button which is needed by some dialogs gets hidden. Therefore, when the user e.g. wants to change communication/GPRS settings, there is no way to accept the changes or close the regarding dialogs. (I have to use these sort of things provided by the operating system - thus, the OS is not entirely hidden).
Is there any possibility to simulate the TaskBar's OK button within my own application? (E.g., by sending a certain Windows-Message indicating the OK-Button pressed?)
Or, alternatively, is it possible to just hide some parts of the TaskBar (e.g., the Start Button) and keep the OK button, clock, and GSM status visible??
2. Somestimes, there appears a system-notification window, e.g. notifying the user about establishing a GPRS connection, or regarding failures. Is it possible to intercept these dialogs and to hide them, or just to disable them such that the user can see it, but tapping the "Cancel" or "Settings" button won't cause any action?
I'm working with Visual Studio 2005/windows Mobile 5.0 SDK in visual c++ and I'm using the HTC ARTEMIS device
Kind regards,
Günther
1. You can send WM_COMMAND with wParam = IDOK.
It must work, because it's how app handle it!
Is there anything I have to consider when sending WM_COMMAND system-wide? A simple PostMessage(NULL, WM_COMMAND,...) seems not to work. Do you see any possibility to get a Windows handle to the active application that should receive the WM_COMMAND message?
Or do you have any idea how applications tell the TaskBar to show the OK or Cancel button? I think this happens via system-wide windows messages, doesn't it? But which messages, and how to intercept them???
Any help is still highly apprechiated (it seems that nobody else did ever have this problem, also in various fora I couldn't yet get an answer... )
I have the same problem with the ok buttom. My PDA have 1 buttom for the camera, so I use this buttom like an OK buttom, for now.
But I´m still trying to make the ok buttom be operacional on the blocked taskbar.

New idea for Taskmanager

Mobile Shell 2.0 brought me to the idea:
It would be great to see preview of all running aplications by sliding from the top bar to the center of the screen (similar to Mobile Shell 2.0).
And then, by sliding left or right you could select the application you want to maximize or by sliding to the top right you could exit this selected application.
Sorry for my poor english, I hope everyone understands what I mean.
Is it possible to programm such a taskmanager? I have no programming skills.
What will be the advantage to tapping on the cross and then see what programs are running?

Shortcut/App to Launch HTC QuickMenu (Please?)

I have a Fuze with everything turned off but what I want (runs quick and smooth). I really don't want 3rd party bloatware and other "TaskManager" or "QuickMenu" applications. I am simply looking for the syntax/shortcut (or maybe small app to launch the built-in HTC QuickMenu that is in the top right corner of the Windows Mobile screen.
I like this QuickMenu and the options that are available... most of all I like that it's already a part of my phone (so hopefully nothing more to install but a shortcut). From what I can tell it's part of the "taskservice.dll" that is loaded in \HKCU\Software\HTC\BootLauncher\TaskManager\
Since the Icon in the top-right for the QuickMenu is so small (and I hate getting out the stylus) I wish to map a shortcut/command-syntax preferrably to Right-Soft Key, or possibly a hardware button like PTT.
I've contacted HTC by email and they simply said it couldn't be done but I know that's probably not the case... I just need a super genious hacker to give me the right syntax/steps to make it work.
Thank you in advance for whoever can help on this!!!!
Michael
*** Please Relocate Thread if I have somehow posted it in the wrong section. Thanks!!! ***
all you have to do to launch QM from a hardware button is maake a shortcut to programs. then, go into \settings\personal\buttons and select your program to run from one of your buttons.
you can also go into qm settings and select the option to replace the start menu.
also, QM is a third party app.
SVI,
Thanks for the reply.. I guess I should have clarified that I am familiar with the steps for creating a shortcut to an EXE however the QuickMenu that is built in to HTC's Fuze is calling a DLL at startup... so the trick would be how do I shortcut/call a DLL file that has been started up as a service??
I am not interested in any other 3rd party QuickMenu, just wanting to find the way to call up the one that is already installed on my phone... ie. by pointing a shortcut (or possibly small launch app) to start up the "taskservice.dll" with whatever tags/options to open the menu on the Today Screen.
Thanks for any additional info you may be able to provide!
Could you found the solution?
no answers yet
Sancho,
I have still been unable to find the solution, and would very much STILL BE interested in finding it. In the meantime I have just used a shortcut to the built-in Taskmgr.exe (\Windows\Taskmgr) or TaskManagerApp.exe also found in Windows. Both programs are different versions of Task Manager and I found that I like Taskmgr a bit better because I can switch to an open application using that version of Task Manager. However I still like the HTC Quickmenu in the top right corner (other than the fact that it is way to small to hit with your finger) and would love to find a way to point a shortcut to the opening it up while on the Today Screen so that I can see running apps, easily close all, switch to one in particular, or see my power & memory settings.
If anyone still has any ideas on how I might accomplish this I would be extremely grateful! Again I am wanting to do this Natively, using the HTC QuickMenu (Taskservices.dll) already built-in and not interested in installing another 3rd party app that takes up memory.
Thanks in Advance for any help that may be offered!
Michael
Thank you for your fast reply!
Re: Shortcut/App to Launch HTC QuickMenu
I just got a fuze and when i went through the settings i found out what your probably trying to do. Go to Start/setting/the small tab on the bottom that you would find your ''hold end key button''/ Hold end key setting. when you get there , they will be a couple settings relating to what you want your end key shorcut to be. then you will click on ''access quick menu'' (or something like that).
The HTC Quick Menu 2.1 (Build 1918.3631) settings:
(Start / Settings / Systems / Task Manager / Button)
Enable the "X" button to end running programs
End programs by tapping "X"
End programs by tapping and holding "X"
Enable Quick Menu on Today screen
(no more...)
I don't think that it is possible to find a shortcut for this. (do hope that I'm wrong and somebody can find the way and share it here though)
But I would like to recommend one of my favorite light apps which can realize what you desired for. It is called HButton and created by an xda contributor, please referhere:
http://hbutton.dyndns.org/
In Hbtton settings, the <Ok/Close> function actually point to the upper-right corner of the screen.
Think you will like it.
No, thanks, I don't want to install 3rd party apps. : )
I think, need to find a solution here, as under Windows the "rundll32.exe" the "taskservice.dll" to run.
Hello,
I use a litte script for that on my TOPAZ (Mortscript is a third party program, but for me indespensable)
Code:
SendSpecial ("win")
Afterwards, you can map it to a button
sudist said:
Hello,
I use a litte script for that on my TOPAZ (Mortscript is a third party program, but for me indespensable)
Code:
SendSpecial ("win")
Afterwards, you can map it to a button
Click to expand...
Click to collapse
This MortScript script is call the "Win" button and open the Start menu.
This is not an option, not a good.
We would like to open the HTC TaskManager (on right-up corner).
sancho1234 said:
We would like to open the HTC TaskManager (on right-up corner).
Click to expand...
Click to collapse
Oups... I understand now
Maybe something like this ???
Code:
Show ("Desktop")
Sleep 500
Mouseclick (470,10)
sudist said:
Oups... I understand now
Maybe something like this ???
Code:
Show ("Desktop")
Sleep 500
Mouseclick (470,10)
Click to expand...
Click to collapse
Thank you. But I think the "sleep" function is not too stable for me. I wrote a similar script already, I have not had good experiences.
Dit you try :
Code:
Show ("Desktop")
WaitForActive ("Desktop")
Mouseclick (470,10)
sudist said:
Dit you try :
Code:
Show ("Desktop")
WaitForActive ("Desktop")
Mouseclick (470,10)
Click to expand...
Click to collapse
Error, because the WaitForActive is need a ",": WaitForActive ("Desktop",)
I try with WaitForActive ("Desktop",[0-3]), no action.
wg5566 said:
I don't think that it is possible to find a shortcut for this. (do hope that I'm wrong and somebody can find the way and share it here though)
But I would like to recommend one of my favorite light apps which can realize what you desired for. It is called HButton and created by an xda contributor, please referhere:
http://hbutton.dyndns.org/
In Hbtton settings, the <Ok/Close> function actually point to the upper-right corner of the screen.
Think you will like it.
Click to expand...
Click to collapse
WG > I looked at the link provided and I am not quite sure I understand. from the looks of it.. it would appear to be another Task Manager type application? But are you saying that when configuring the "<Ok/Close>" function and using it, that it will activate the Quick Menu on the Today Screen by "pointing ot the upper-right corner of the screen"? or have I misunderstood you?
If in fact it activates the Quick Menu on the Today screen by activating the upper-right corner, then it may be an app worth trying.
If you could reply and please clarify that would be great.
If anyone else has additional info to add on how I might do this natively that would be AWESOME!
Thanks in advance for your help!
wow... lol. ok so I guess there's been a few more posts since WG posted and my reply to his was a bit outta place.
But it sounds like Sancho unerstands what I am looking for.
I am not looking for another Task Manager/Menu, or the "Quick Access List" menu as defined by the "Long Press End Key" in the System Settings.
I am looking for the shortcut/syntax/code/scrip to access what is referred to in the Registry as the HTCQuickMenu (running taskservices.dll) and execute the drop down on the today screen from the small icon in the upper-right corner looks like: ≡ˇ
thanks!
sancho1234 said:
I try with WaitForActive ("Desktop",[0-3]), no action.
Click to expand...
Click to collapse
Hello, sorry for the waiting (I was on a boattrip )
First you need to know how your desktop is called with this script:
You clic on this script and hurry to your desktop (the windowname is showed for 5 sec
Code:
Sleep 5000
X1 = ActiveWindow()
Sleepmessage (5, X1)
The you copy this windowname in the script
Code:
Show ("NAME")
WaitForActive ("NAME", 6)
Mouseclick (470,10)

Categories

Resources