Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: detect if user has admin privilege Pin
Daniel Turini24-Nov-02 21:09
Daniel Turini24-Nov-02 21:09 
GeneralRe: detect if user has admin privilege Pin
devvvy24-Nov-02 21:47
devvvy24-Nov-02 21:47 
GeneralRe: detect if user has admin privilege Pin
Daniel Turini24-Nov-02 22:06
Daniel Turini24-Nov-02 22:06 
GeneralCreating a window in an ATL without MFC Pin
Jerome Conus24-Nov-02 20:19
Jerome Conus24-Nov-02 20:19 
GeneralRe: Creating a window in an ATL without MFC Pin
Daniel Turini24-Nov-02 22:12
Daniel Turini24-Nov-02 22:12 
GeneralPreTranslateMessage question Pin
Mel Feik24-Nov-02 19:45
Mel Feik24-Nov-02 19:45 
GeneralRe: PreTranslateMessage question Pin
Christian Graus24-Nov-02 20:21
protectorChristian Graus24-Nov-02 20:21 
GeneralRe: PreTranslateMessage question Pin
Mel Feik24-Nov-02 20:39
Mel Feik24-Nov-02 20:39 
Actually, OnChar or OnKeyDown would be fine as well. Was having problems getting the '^' detected (ASCII 0x5E). I knocked this out. A little clumsy but does the job. What I'm doing is dis-allowing the '^' as valid input as I have device that uses that uses the character internally so allow the user to type that into the data going in will cause problems. Basically I was thinking that I would send out a MessageBox each the user hit one of the invalid keys reminding them what they can't use and returning the edit at the same location that the char was typed (minus the char of course). This works but as I said, its clumsy - I was more looking to get something working in a hurry so I could move on with it working:
<br />
BOOL CRHTC100Dlg::PreTranslateMessage(MSG *pMsg)<br />
{<br />
if( WM_KEYDOWN == pMsg->message && 0x36 == pMsg->wParam && m_nShiftFlag )<br />
{<br />
	//mystuff to go here<br />
	// tell the system that the key-press was handled<br />
	return TRUE;<br />
}<br />
else;<br />
if( WM_KEYDOWN == pMsg->message || WM_KEYUP == pMsg->message)<br />
	if(VK_SHIFT == pMsg->wParam)<br />
		m_nShiftFlag = 1;<br />
else<br />
	m_nShiftFlag = 0;<br />
// for all other messages, perform normal processing<br />
return( CDialog::PreTranslateMessage( pMsg ) );<br />
}//end of PreTranslateMessage()<br />


I'll likely take a stab using OnKeyDown (if I can detect the '^') as it should save me from have to go back and remove the char and adjust the cursor postion. How was the weekend?
[edit]I just figured that using PreTranslateMessage was going be the least amount of effort on my part but I mis-guessed on that considering the difficulty it gave me (twenty minutes on that was at least 15 to many).[/edit]

---------------------------------------------

The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?

- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!

If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler <

GeneralRe: PreTranslateMessage question Pin
Christian Graus24-Nov-02 20:46
protectorChristian Graus24-Nov-02 20:46 
GeneralRe: PreTranslateMessage question Pin
Christian Graus24-Nov-02 20:51
protectorChristian Graus24-Nov-02 20:51 
GeneralRe: PreTranslateMessage question Pin
Mel Feik24-Nov-02 21:05
Mel Feik24-Nov-02 21:05 
GeneralRe: PreTranslateMessage question Pin
Cosmin Marin25-Nov-02 0:52
Cosmin Marin25-Nov-02 0:52 
GeneralAdding text to toolbar buttons into a standard MFC SDI App Pin
Alex Cramer24-Nov-02 18:35
Alex Cramer24-Nov-02 18:35 
GeneralRe: Adding text to toolbar buttons into a standard MFC SDI App Pin
Anonymous25-Nov-02 23:46
Anonymous25-Nov-02 23:46 
Generalhelp! CreateThread! Pin
devvvy24-Nov-02 18:13
devvvy24-Nov-02 18:13 
GeneralRe: help! CreateThread! Pin
Michael Dunn24-Nov-02 18:20
sitebuilderMichael Dunn24-Nov-02 18:20 
GeneralRe: help! CreateThread! Pin
devvvy24-Nov-02 18:40
devvvy24-Nov-02 18:40 
GeneralRe: help! CreateThread! Pin
devvvy24-Nov-02 18:47
devvvy24-Nov-02 18:47 
Questionhow can i repair and compact the access2000 database using ado in vc? Pin
whelk24-Nov-02 17:42
whelk24-Nov-02 17:42 
AnswerRe: how can i repair and compact the access2000 database using ado in vc? Pin
paulb24-Nov-02 18:07
paulb24-Nov-02 18:07 
GeneralRe: how can i repair and compact the access2000 database using ado in vc? Pin
whelk24-Nov-02 18:58
whelk24-Nov-02 18:58 
GeneralRe: how can i repair and compact the access2000 database using ado in vc? Pin
Alexinuk25-Nov-02 3:12
Alexinuk25-Nov-02 3:12 
Generalthe CDaodatabase dont support access2000 Pin
whelk25-Nov-02 14:52
whelk25-Nov-02 14:52 
GeneralToolbar dependent bitmaps in my Popup menus Pin
Mr Bose Dayala24-Nov-02 17:31
Mr Bose Dayala24-Nov-02 17:31 
GeneralCreating Line Count for CRich Edit Control Pin
E324-Nov-02 16:34
E324-Nov-02 16:34 

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.