Click here to Skip to main content
15,903,012 members
Home / Discussions / Mobile
   

Mobile

 
QuestionUI effects Pin
Ahmed Charfeddine4-Aug-08 21:47
Ahmed Charfeddine4-Aug-08 21:47 
QuestionSMS via VB DOT NET Pin
msmahmood644-Aug-08 21:39
msmahmood644-Aug-08 21:39 
AnswerRe: SMS via VB DOT NET Pin
fjptlzx4-Aug-08 21:59
fjptlzx4-Aug-08 21:59 
QuestionAbout ListView Create Pin
Member 34113024-Aug-08 18:38
Member 34113024-Aug-08 18:38 
Questionsoft input panel Pin
iayd2-Aug-08 3:41
iayd2-Aug-08 3:41 
AnswerRe: soft input panel Pin
akirilov3-Aug-08 23:24
akirilov3-Aug-08 23:24 
QuestionNew To Mobile Applications Need Help Pin
Krazy Programmer1-Aug-08 22:09
Krazy Programmer1-Aug-08 22:09 
QuestionKeypad mapping Pin
MS_TJ1-Aug-08 1:03
MS_TJ1-Aug-08 1:03 
I am developing Application using Wince.Net.
I want to remap the Keys.means we use the rotary switch for navigational purpose so i want to do that when i rotate the switch it act like left arrow key when press it it act like enter key pls help me


#include "stdafx.h"
#include "resource.h"
#include "Types.h" //Include All Global Variable And Function.
#include "tchar.h"
#define TIMER_DISPLAY 1

#include "CMonApp.h"
// Global Variables for Application
CMonApp oCMonApp;
void tempwave(HWND);

// Global Variables:
HINSTANCE ghInst; // current instance
HWND ghWnd; // Main Application Window, parent to all other windows.
wchar_t szTitle[STRTAB_STRINGSIZE]; // The title bar text
wchar_t szAppName[STRTAB_STRINGSIZE]; // The title bar text

// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK MenuDlgProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
SignalStarted(_wtol(lpCmdLine));
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance, IDS_Wnd_Class_Name, (LPTSTR)szAppName, STRTAB_STRINGSIZE);
// Load the Application Name String from String Table.
LoadString(hInstance, IDS_TITLE, (LPTSTR)szTitle, STRTAB_STRINGSIZE);
// Load the Application Title String from String Table.
MyRegisterClass(hInstance); //Call function MyRegisterClass to Create Class of Main Application

// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDS_TITLE);

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

return msg.wParam;
}



//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASS wc;

wc.style = 0;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = 0;
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = 0;
wc.lpszClassName = (LPTSTR)szAppName;

return RegisterClass(&wc);
}

//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;

ghInst = hInstance; // Store instance handle in our global variable

ghWnd = CreateWindow((LPTSTR)szAppName,(LPTSTR)szTitle, WS_VISIBLE|WS_POPUP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

if (!ghWnd)
{
return FALSE;
}
nCmdShow = SW_SHOWMAXIMIZED;
ShowWindow(ghWnd, nCmdShow);
ShowCursor(FALSE);
UpdateWindow(ghWnd);

return TRUE;
}

//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
HWND hTray;
HFONT hFont;
static sicount;
//CDisplayResources oCDisplay;
switch (message)
{ // This message is sent when an application requests that a window be created by calling the CreateWindow
case WM_CREATE:
//Application Start-up Process
// Create various modules of the application.
// These objects have been created at run-time (instead of static allocation) to have run-time control on them.
oCMonApp.mpoDataCaputre = new CDataCapture;
oCMonApp.mpoDataStore = new CDataStore;
oCMonApp.mpoDataDisplay = new CDataDisplay( ghWnd);

// Setup various modules
// Register various modules with each other, where ever required
oCMonApp.mpoDataCaputre->RegisterFriends(oCMonApp.mpoDataStore);
oCMonApp.mpoDataDisplay->RegisterFriends(oCMonApp.mpoDataStore);

// All the modules are created and setup now.
// Start the process of data capture, display etc.


oCMonApp.mpoDataCaputre->StartDataCapture();

// Sample code for Trace calls.
CMonTrace1("Sample Trace1\n", 0, 0, 0, 0, 0);
CMonTrace2("Sample Trace2\n", 0, 0, 0, 0, 0);
CMonTrace3("Sample Trace3\n", 0, 0, 0, 0, 0);
//hTray=FindWindow(L"Shell_TrayWnd",NULL);
//ShowWindow(hTray,FALSE);
SetTimer(hWnd,TIMER_DISPLAY,10000,NULL);

break;

case WM_PAINT:
//MessageBox(NULL,TEXT("WE are in Paint"),TEXT("CMON.CPP"),MB_OK);
CMonTrace1("WndProc: WM_PAINT Msg\n", 0, 0, 0, 0, 0);

PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);

oCMonApp.mpoDataDisplay->DrawFreshDisplay();
break;

case WM_CMON_TICK: // Application defined message for Primary Time Tick
CMonTrace1("WndProc: WM_CMON_TICK Msg.\n", 0, 0, 0, 0, 0);
oCMonApp.mpoDataDisplay->UpdateDisplay();

break;

case WM_DESTROY:
// Delete all objects created during Start-up Process.
delete oCMonApp.mpoDataCaputre;
delete oCMonApp.mpoDataDisplay;
delete oCMonApp.mpoDataStore;

PostQuitMessage(0);
break;

case WM_KEYDOWN: // This message is posted to the window with the keyboard focus when a nonsystem key is pressed.
switch(wParam)
{
case VK_HOME:
DialogBox(ghInst,MAKEINTRESOURCE(IDD_MENU),hWnd,MenuDlgProc);
break;

case VK_END:
// Delete all objects created during Start-up Process.
delete oCMonApp.mpoDataCaputre;
delete oCMonApp.mpoDataDisplay;
delete oCMonApp.mpoDataStore;
PostQuitMessage(0); // This indicates to the system that a thread has made a request to terminate (quit).
break;

default:
break;
}
break;
//case WM_TIMER:
// //tempwave(hWnd);
// HDC hDc;
// HPEN hPen;
// RECT Rect;
// hDc=GetDC(hWnd);
// HBRUSH hBrush;
// hPen = CreatePen( PS_SOLID, 1,RGB(0,0,255));
// SelectObject( hDc, hPen);
// hBrush = CreateSolidBrush( RGB(0,0,0));
// SelectObject( hDc, hBrush);
// GetClientRect(hWnd,&Rect);
//
/*switch(wParam)
{
case TIMER_DISPLAY:
HDC hDc;
HPEN hPen;
RECT Rect;
hDc=GetDC(hWnd);
HBRUSH hBrush;
hPen = CreatePen( PS_SOLID, 1,RGB(0,0,255));
SelectObject( hDc, hPen);
hBrush = CreateSolidBrush( RGB(0,0,0));
SelectObject( hDc, hBrush);
GetClientRect(hWnd,&Rect);
for(int x=10;x<rect.right-150;x+> {
MoveToEx(hDc,x,20,NULL);
LineTo(hDc,x,Rect.bottom);
}
for(int y=20;y<rect.bottom;y+> {
MoveToEx(hDc,0,y,NULL);
LineTo(hDc,Rect.right-158,y);
}
}*/
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
/**********************************************************************************************
* Name : GetCMonInstance.
*
* Synopsis : Get the Global Instance.
*
* Return Value:
* ghInst-(HINSTANCE)Return Instance.
*************************************************************************************************/
HINSTANCE GetCMonInstance()
{
return( ghInst);
}

/**********************************************************************************************
* Name : GetCMonWindow.
*
* Synopsis : Get HANDEL of Window.
*
* Return Value:
* ghWnd-(HWND)Return Handle Of window.
*************************************************************************************************/
HWND GetCMonWindow()
{
return( ghWnd);
}

BOOL CALLBACK MenuDlgProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
HMENU hMenuMain,hMenu;
//MapWindowPoints(hWnd,HWND_DESKTOP,&pt,1);
hMenuMain=LoadMenu(ghInst,MAKEINTRESOURCE(IDR_MENU2));
hMenu=GetSubMenu(hMenuMain,0);
int uError=0;
HANDLE hButton;
hButton=GetDlgItem(hWnd,IDC_BUTTON1);

TPMPARAMS tpm;
tpm.cbSize=sizeof(tpm);
GetClientRect(hWnd,&tpm.rcExclude);
switch(wMsg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_BUTTON1:
SendMessage((HWND)hButton,BM_SETSTATE,1,0);
uError=TrackPopupMenuEx(hMenu,TPM_LEFTALIGN|TPM_RETURNCMD|TPM_TOPALIGN,10,320,hWnd,&tpm);
if(uError==0)
{
MessageBox(NULL,TEXT("ERROR"),TEXT("BUT1"),MB_OK);
}
return TRUE;
}
break;

/* case WM_ENTERMENULOOP:
MessageBox(NULL,TEXT("Enter"),TEXT(""),MB_OK);
break;*/
}
return FALSE;
}

void tempwave(HWND hWnd)
{
HDC hDc;
HPEN hPen;
RECT Rect;
hDc=GetDC(hWnd);
HBRUSH hBrush;
hPen = CreatePen( PS_SOLID, 5,RGB(0,0,255));
SelectObject( hDc, hPen);
hBrush = CreateSolidBrush( RGB(0,0,0));
SelectObject( hDc, hBrush);
GetClientRect(hWnd,&Rect);
//// /////////////////////////////////
/*hPen = CreatePen( PS_SOLID, 5,RGB(0,0,255));
SelectObject( hDc, hPen);
hBrush=CreateSolidBrush(RGB(0,0,0));
hBrush=(HBRUSH) GetStockObject(WHITE_BRUSH);
hDc = GetDC(hWnd);
GetClientRect(hWnd,&Rect);
MoveToEx(hDc,Rect.right/2,0,NULL);
LineTo(hDc,Rect.top,Rect.bottom);*/
/////////////////////////////////

for(int x=10;x<rect.right-150;x+> {
MoveToEx(hDc,x,20,NULL);
LineTo(hDc,x,Rect.bottom);
}
for(int y=20;y<rect.bottom;y+> {
MoveToEx(hDc,0,y,NULL);
LineTo(hDc,Rect.right-158,y);
}
if (hBrush)
{
DeleteObject( hBrush );
}
// Delete your pen.
if (hPen)
{
SelectObject( hDc, hPen );
DeleteObject( hPen );
}

}
AnswerRe: Keypad mapping Pin
akirilov1-Aug-08 4:31
akirilov1-Aug-08 4:31 
GeneralRe: Keypad mapping Pin
MS_TJ1-Aug-08 19:20
MS_TJ1-Aug-08 19:20 
GeneralRe: Keypad mapping Pin
akirilov3-Aug-08 21:38
akirilov3-Aug-08 21:38 
Questionneed to start data connection automatically for my app Pin
Muhammad Rafiq30-Jul-08 4:05
Muhammad Rafiq30-Jul-08 4:05 
QuestionDLL sizes on CE Pin
Jim Crafton29-Jul-08 7:17
Jim Crafton29-Jul-08 7:17 
AnswerRe: DLL sizes on CE Pin
Mike Dimmick31-Jul-08 1:58
Mike Dimmick31-Jul-08 1:58 
GeneralRe: DLL sizes on CE Pin
Mike Dimmick31-Jul-08 4:36
Mike Dimmick31-Jul-08 4:36 
GeneralRe: DLL sizes on CE Pin
Jim Crafton1-Aug-08 10:14
Jim Crafton1-Aug-08 10:14 
QuestionMobile Web Application on Pocket PC 2003 Emulator Pin
Ian Uy29-Jul-08 2:34
Ian Uy29-Jul-08 2:34 
AnswerRe: Mobile Web Application on Pocket PC 2003 Emulator Pin
Slick6926-Aug-08 10:18
Slick6926-Aug-08 10:18 
QuestionProblem to connect PDA with database. Pin
Sritanu _ Ghosh28-Jul-08 21:37
Sritanu _ Ghosh28-Jul-08 21:37 
AnswerRe: Problem to connect PDA with database. Pin
Pavel Klocek5-Aug-08 1:14
Pavel Klocek5-Aug-08 1:14 
AnswerRe: Problem to connect PDA with database. Pin
AlexeiXX36-Aug-08 14:39
AlexeiXX36-Aug-08 14:39 
GeneralRe: Problem to connect PDA with database. Pin
Sritanu _ Ghosh27-Aug-08 3:35
Sritanu _ Ghosh27-Aug-08 3:35 
QuestionPlay sound on Smartphone/PDA Pin
Parasmani Swamy28-Jul-08 20:25
Parasmani Swamy28-Jul-08 20:25 
AnswerRe: Play sound on Smartphone/PDA Pin
daxfrost30-Jul-08 20:41
daxfrost30-Jul-08 20:41 
QuestionC++ Getting Current Time for smartphone Pin
Lou7624-Jul-08 2:57
Lou7624-Jul-08 2:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.