|
1.Wanted to receive the events,same like buttons.As my form is very small and needs to handle many events, I wants to use softkeys to reduce some buttons.
2.Wanted to make the form more colorful.Its Ok I managed to change the backcolor property.
3.Yes,I wanted to terminate the code by explicitly mentioning Applicatio.Exit but its just hanging,is there any other way to kill the process safely(programmatically)?
4.Yes,I have tried CAB program, but after successfully running in PDA,I just can't see my app in PDA?
Sorry for bugging you with so many doubts,thanks a lot.
|
|
|
|
|
1. I haven't tried this, but here is some code I found on the web: http://forums.devbuzz.com/tm.asp?m=38708&p=1&tmode=1[^]
2. Cool.
3. If your app is hanging after Application.Exit() gets called, then there is probably something else in your code keeping it from exiting. Are you using any threads or timers that aren't being terminated before trying to close the application? I have found that when I explicitly call Application.Exit(), it does in fact unload the app as I expect (or at least I've just assumed that and never checked to make sure ).
4. You will need to specify a shortcut in the "Start Menu" special folder. Take a look at this screenshot:
http://www.matthew-long.com/images/installer_properties.png[^]
You will also need to specify an icon for you application in the Application Properties like this:
http://www.matthew-long.com/images/app_properties.png[^]
Finally, you may want to soft reset your PDA. Icons get cached, so they need to be refreshed through a rest in order to show up correctly.
Let me know if you have further questions.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Let me try again on number 1. You said Soft Keys and I'm thinking the whole time you meant hardware keys. Anyhow, here is a little tidbit I found this morning on soft keys in Windows Mobile 5.0:
Adding smart keys to an application is as simple as designing a menu. When designing your application, simply create a menu with only two choices. When the application executes, Windows Mobile 5.0 will map each menu choice to a soft key. Windows Mobile 5.0 automatically provides this behavior to any application containing a menu with one or two choices. Menus containing more then two choices are rendered as a traditional menu.
I haven't tested this, but I got it from here: http://msdn2.microsoft.com/en-gb/library/ms839548.aspx[^]
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Thanks a lot for your replies.
3.Yes, I am using System.Threading.Timers which triggers CallBack function events every few secs(Certain time interval) which is communicating with the server.We are using Timer.Dispose when App is closing but it not seems to be working, the requests are still going to server,thatmeans timer is running at the background.
I have used IDisposable interface to dispose the object possesing Timer, but its throwing StackOver flow Exception on disposing which cannot be handled even by Catch block.
After trying all the ways, I finally decided to Kill the Process Programmitically,what do you say?
In .NetFramework there is also a method called Environment.Exit but I cannot find it in .NetCompactFramework.
Please advise me..
The link you have given in 1 (regarding softkeys),page cannot found is coming,please resend.
Thanks again
|
|
|
|
|
I know this is stating the obvious but are you stopping the timer first before trying to call dispose? (just want to make sure).
Honestly, I think you really need to track down the real issue rather than trying to kill the process. Something is not right in the app and I promise it will not benefit you to just ignore the problem and try to kill the process. That being said, if you really want to kill it, take a look at Process.Kill() here: http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.kill(VS.80).aspx[^]
Here's a note from that page:
The Kill method executes asynchronously. After calling the Kill method, call the WaitForExit method to wait for the process to exit, or check the HasExited property to determine if the process has exited.
I am not familiar with Envrionment.Exit(). You'll probably have to use something else, though, since it is not available in the compact framework.
And as far as the link in #1 goes, don't worry about it. If you see my previous post (where I respond to myself), you'll see that I was sending you to look at a link about hardware keys, not softkeys.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi perlmunger
Thanks a lot for your advises,they are very useful for us , I will avoid using Kill method and try to trace out the wrong thing in my App.
I will get back to you if any doubts.
Thanks
Aruna
|
|
|
|
|
1. There is codeproject article on capturing hardware key events.
2. You can add a background image to a form by overriding the paint event and using GDI to draw a bitmap on the form. I do this.
3. me.close, then application.exit
If you still have the problem use the debugger to see if the application is hanging during the form's dispose event and determine which object is causing the problem.
|
|
|
|
|
I develop own SIP (Soft Input Panel) which should have an opportunity to recognize the symbols drawn on all screen. Like Transcriber, but only for separate symbols. Has collided with 2 problems:
1) Interception of mouse events (can't set global hook)
2) If to draw on screen: GetDC(0)... after drawing it is impossible to refresh screen.
First method (I also tried to use NULL instead of GetDesktopWindow() in all methods)
#define SetWindowRedraw(hwnd, fRedraw) \
((void)SNDMSG(hwnd, WM_SETREDRAW, (WPARAM)(BOOL)(fRedraw),0L))
SetWindowRedraw(GetDesktopWindow(), TRUE);
RedrawWindow(GetDesktopWindow(), NULL, NULL, RDW_INVALIDATE |RDW_UPDATENOW |RDW_ALLCHILDREN);
Second method:
InvalidateRect(GetDesktopWindow(),NULL,FALSE);
UpdateWindow(GetDesktopWindow());
Third method:
RedrawWindow(GetDesktopWindow(),NULL,NULL,RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_UPDATENOW );
Whether there are other ways of realization of drawing and recognition on all screen? Thought above creation of a topmost window with copying a contained desktop, but it would be desirable, all the same to make similarly Transcriber
|
|
|
|
|
.cpp
In XXX_Init
...
ActivateKBHook(GetModuleHandle(NULL), LowLevelKeyboardProc);
...
Rest of code:
//globals
HINSTANCE g_hHookApiDLL = NULL; //handle to coredll.dll, where all the hook related APIs are present
HHOOK g_hInstalledLLKBDhook = NULL; //g_hInstalledLLKBDhook represents handle to the installed KB hook
//WINCEKBHOOK_API BOOL ActivateKBHook(HINSTANCE hInstance, HOOKPROC LLKeyboardHookCallbackFunction)
BOOL ActivateKBHook(HINSTANCE hInstance, HOOKPROC LLKeyboardHookCallbackFunction)
{
//we need to manually load these standard Win32 API calls
//MSDN states that these aren't supported in WinCE
SetWindowsHookEx = NULL;
CallNextHookEx = NULL;
UnhookWindowsHookEx = NULL;
//now load the coredll.dll
g_hHookApiDLL = LoadLibrary(_T("coredll.dll"));
if(g_hHookApiDLL == NULL)
{
//something is awfully wrong
//the dll has to be present
MessageBox(NULL, L"Can't Load coredll", L"Error", MB_OK);
return false;
}
else
{
//load the SetWindowsHookEx API call
//the SetWindowsHookEx function installs an application-defined hook procedure into a hook chain.
//You would install a hook procedure to monitor the system for certain types of events.
//here we use use the hook to monitor kyeboard events
SetWindowsHookEx = (_SetWindowsHookExW)GetProcAddress(g_hHookApiDLL, _T("SetWindowsHookExW"));
if(SetWindowsHookEx == NULL)
{
//this means that MS has really stopped supporting this API in WinCE
return false;
}
else
{
//install the KB hook
//the handle needs to be saved for default processing of the events and to uninstall the hook, once we re done with it
g_hInstalledLLKBDhook = SetWindowsHookEx(WH_KEYBOARD_LL, LLKeyboardHookCallbackFunction, hInstance, 0);
if(g_hInstalledLLKBDhook == NULL)
{
MessageBox(NULL, L"Can't Set Hook", L"Error", MB_OK);
return false;
}
}
//load CallNextHookEx() API call
//the CallNextHookEx function passes the hook information to the next hook procedure in the current hook chain.
//we use this call for default processing of events.
CallNextHookEx = (_CallNextHookEx)GetProcAddress(g_hHookApiDLL, _T("CallNextHookEx"));
if(CallNextHookEx == NULL)
{
MessageBox(NULL, L"Can't Call Hook", L"Error", MB_OK);
return false;
}
//load UnhookWindowsHookEx() API
//the UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.
//we use this call to unistall the hook.
UnhookWindowsHookEx = (_UnhookWindowsHookEx)GetProcAddress(g_hHookApiDLL, _T("UnhookWindowsHookEx"));
if(UnhookWindowsHookEx == NULL)
{
MessageBox(NULL, L"Can't Unhook Hook", L"Error", MB_OK);
return false;
}
}
//all the APIs are loaded and the application is hooked
return true;
}
//WINCEKBHOOK_API BOOL DeactivateKBHook()
BOOL DeactivateKBHook()
{
//unload the hook
if(g_hInstalledLLKBDhook != NULL)
{
UnhookWindowsHookEx(g_hInstalledLLKBDhook);
g_hInstalledLLKBDhook = NULL;
MessageBox(NULL, L"Unhooked Hook", L"Error", MB_OK);
}
//unload the coredll.dll
if(g_hHookApiDLL != NULL)
{
FreeLibrary(g_hHookApiDLL);
g_hHookApiDLL = NULL;
MessageBox(NULL, L"Unloaded DLL", L"Error", MB_OK);
}
//we have terminated gracefully
return true;
}
/****************************************************************
WH_KEYBOARD_LL hook procedure
****************************************************************/
LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
MessageBox(NULL, L"Callback", L"key", MB_OK);
CHAR szBuf[128];
HDC hdc;
static int c = 0;
size_t * pcch = 0;
HRESULT hResult;
if (nCode < 0) // do not process message
return CallNextHookEx(g_hInstalledLLKBDhook, nCode,wParam, lParam);
hdc = GetDC(NULL);
hResult = StringCchPrintf(CA2W(szBuf), 128/sizeof(TCHAR), L"KEYBOARD - nCode: %d, vk: %d, %d times ", nCode, wParam, c++);
if (FAILED(hResult))
{
// TODO: write error handler
}
hResult = StringCchLength(CA2W(szBuf), 128/sizeof(TCHAR), pcch);
if (FAILED(hResult))
{
// TODO: write error handler
}
MessageBox(NULL, CA2W(szBuf), L"key", MB_OK);
ReleaseDC(NULL, hdc);
return CallNextHookEx(g_hInstalledLLKBDhook, nCode, wParam, lParam);
}
In the header .h
#ifndef _WINCE_KB_HOOK_H
#define _WINCE_KB_HOOK_H
//used for passing to SetWindowsHookEx funtion to set a Low level (LL) keyboard hook
#define WH_KEYBOARD_LL 20
// Define the function types used by hooks
typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
typedef HHOOK (WINAPI *_SetWindowsHookExW)(int, HOOKPROC, HINSTANCE, DWORD);
typedef LRESULT (WINAPI *_CallNextHookEx)(HHOOK, int, WPARAM, LPARAM);
typedef LRESULT (WINAPI *_UnhookWindowsHookEx)(HHOOK);
// For the low level keyboard hook, your keyboards procedures is passed a pointer to KBDLLHOOKSTRUCT instance
typedef struct {
DWORD vkCode;
DWORD scanCode;
DWORD flags;
DWORD time;
ULONG_PTR dwExtraInfo;
} KBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;
// Win32 Hook APIs
static _SetWindowsHookExW SetWindowsHookEx;
static _UnhookWindowsHookEx UnhookWindowsHookEx;
static _CallNextHookEx CallNextHookEx;
//WINCEKBHOOK_API BOOL ActivateKBHook(HINSTANCE hInstance, HOOKPROC LLKeyboardHookCallbackFunction);
BOOL ActivateKBHook(HINSTANCE hInstance, HOOKPROC LLKeyboardHookCallbackFunction);
//WINCEKBHOOK_API BOOL DeactivateKBHook();
BOOL DeactivateKBHook();
#endif
|
|
|
|
|
We are using SHNOTIFICATIONDATA to show icon on the upper toolbar on Windows
Mobile 5. But we can't find out how to send a message to our window when we
click on the icon, without showing any pop-up window.
Our code:
SHNOTIFICATIONDATA* pNotification = NULL;
HICON hIconn = NULL;
hIconn = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
pNotification = (SHNOTIFICATIONDATA*)malloc(sizeof(SHNOTIFICATIOND ATA));
pNotification->dwID = ICON_ID;
pNotification->clsid = guidPPCAlertsApp; npPriority = SHNP_INFORM;
pNotification->csDuration = 10; hwndSink = m_hWnd; pszHTML =
pNotification->_T("...");
pNotification->hicon = hIconn;
pNotification->cbStruct = sizeof(SHNOTIFICATIONDATA); pszTitle =
pNotification->TEXT("Application name"); grfFlags = SHNF_STRAIGHTTOTRAY;
SHNotificationAdd( pNotification );
!??
|
|
|
|
|
Can sm one tell me which on is better from the programmer's point of view, using SIP or H.323 or the combination of these, considerig feasibility aspect in wireless communication?
sumit
|
|
|
|
|
Hi, I need to work with an old database which I think is CEDB (.vol file), I'm developing in VS.Net 2005 (VB) and just need to do some basic bits. I have no idea what I'm doing!!! Any help whatsoever would be very much appreciated.
|
|
|
|
|
Hi guys
have been asked to do some maintenance on a mobile app in VS 2005
when i build and runthe app the emulator fires up and reports the following error
"This application (Mytestapp.exe ) requires newer version of the Microsoft .net compact framework than the version installed on this device"
is there a fix for this?
i tried getting the .NET Compact Framework 2.0 Redistributable however it wont install onthe PC when it has VS 2005 on it (!)
how do i work around this issue as i dont have a physical device to use?
cheers
Bryce
|
|
|
|
|
Dear Bryce - read the interweb
f you have VS 2005 installed and are developing the app then just connect to the device in VS and deploy it. Make sure your project properties has the
"Deploy the latest version of the .NET Compact Framework (including service packs)" checked. It is found under "Devices".
cheers
Bryce
|
|
|
|
|
oh cool thanks Bryce
Bryce
|
|
|
|
|
Hi,
I am SivaRamaRaju working as a .net developer.
In my asp.net mobile web application,I am displaying the list of contacts which are in the database. The problem here is I want to save the list of contacts in the mobile application to PDA (Personal Distal Assistance)
Can anybody help me how can I save these list of contacts to PDA
Thanks and regards
Siva.
-- modified at 0:31 Thursday 1st February, 2007
|
|
|
|
|
hi all
plz tell me the way how to read the images from webcam in c#.net
and suggest the good tutorials
thank s in advance
|
|
|
|
|
Hi,
I am doing my final thesis on bluetooth. I m trying to implement routing and sharing of services in bluetooth scartternet using c#. I need some initial help bcoz I m new to c#. Is there any API and any other resources that can help me.
Thanks
|
|
|
|
|
Hi all,
I have a Embeded VC++ (4.0) application , which builds fine to run on a device having Win CE 4.2 , But when i try to build the same workspace to run on a device having Win CE 3.0. I get a "Platform Manager server failed error".
Do i need to do some configuration settings for the Platform Manager under Tools Menu?
What settings do i need to do?.
Thanks (in advance)
|
|
|
|
|
You must use eVC 3.0 and an appropriate SDK for debugging/deployment on Windows CE 3.0-based devices. eVC 4.0 only works with CE 4.0 or later devices (you need at least SP1 for CE 4.1, SP3 for CE 4.1 and 4.2, and SP4 for CE 4.1, 4.2 and 5.0 - SP2 added 4.2 support but removed support for 4.1!) There were some changes in the OS's debugging support between v3.0 and 4.0.
It's recommended to install eVC 3.0 before 4.0 if you have the choice, but it should work if you install 3.0 after 4.0.
Download eVC 3.0 from here[^]. That includes the Pocket PC 2002 SDK.
|
|
|
|
|
Thanks
modified 28-Sep-16 7:21am.
|
|
|
|
|
|
Hello,I ever never thought about develop an application for winCE that will run on PDA. Now I have to do it during a short term.
Can anyone tell me the flow to develop winCE application ?
development tools:
.NET2005
vb.net
are there any samples for reading?
thanks...
limin...
|
|
|
|
|
Hey Buddy,
I am facing same kind of problem. If you come across of some good resource kindly let me know. I will also inform you as soon as I got something concrete.
Saksham
Smart Device & Pocket PC Developer
developersaksham@gmail.com
|
|
|
|
|
I'm developing an application on Win CE 4.2 using Visual Studio .Net 2003.
Just after calling InitializeComponent from the main form's constructor and before any line of InitializeComponent method being processed, the application gives an error (which is not catchable using try-catch block)
Fatal Application Error
Application Terminal.exe has performed an illegal operation and will be shut down. If the problem persists contact the program vendor.
Program: Terminal.exe
Exception: 0xc0000005
Address: 01690cdc
Any ideas?
Thanks in advance
|
|
|
|
|