Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: help Pin
gentleguy28-Jan-08 20:30
gentleguy28-Jan-08 20:30 
GeneralRe: help Pin
CPallini28-Jan-08 21:47
mveCPallini28-Jan-08 21:47 
QuestionRe: help Pin
David Crow29-Jan-08 2:44
David Crow29-Jan-08 2:44 
GeneralRe: help Pin
KarstenK29-Jan-08 3:06
mveKarstenK29-Jan-08 3:06 
Generalgetchar() help Pin
gentleguy28-Jan-08 15:04
gentleguy28-Jan-08 15:04 
QuestionRe: getchar() help Pin
David Crow28-Jan-08 15:56
David Crow28-Jan-08 15:56 
GeneralGetForegroundWindow() Pin
dellthinker28-Jan-08 8:12
dellthinker28-Jan-08 8:12 
GeneralRe: GetForegroundWindow() Pin
David Crow28-Jan-08 8:20
David Crow28-Jan-08 8:20 
dellthinker wrote:
But i get an error.

error C2664: 'strcmp' : cannot convert parameter 2 from 'struct HWND__ *(__stdcall *)(void)' to 'const char *'


The GetForegroundWindow() function returns a handle to the foreground window, while the second argument to strcmp() is a null-terminated string (to compare). Of course, you already knew all of this.

dellthinker wrote:
How do i compare what GetForegroundWindow returns so i can make my app look for a specific window?


By also employing GetWindowText(). Otherwise, checkout FindWindow().

"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


GeneralRe: GetForegroundWindow() Pin
dellthinker28-Jan-08 13:20
dellthinker28-Jan-08 13:20 
GeneralRe: GetForegroundWindow() Pin
Mark Salsbery28-Jan-08 13:47
Mark Salsbery28-Jan-08 13:47 
GeneralRe: GetForegroundWindow() Pin
dellthinker28-Jan-08 14:48
dellthinker28-Jan-08 14:48 
AnswerRe: GetForegroundWindow() Pin
fd012900228-Jan-08 13:51
fd012900228-Jan-08 13:51 
Generaltest Pin
Member 462175228-Jan-08 7:44
Member 462175228-Jan-08 7:44 
GeneralRe: test Pin
CPallini28-Jan-08 7:56
mveCPallini28-Jan-08 7:56 
GeneralRe: test Pin
Hamid_RT28-Jan-08 19:16
Hamid_RT28-Jan-08 19:16 
GeneralGDI+ NOISE problem Pin
followait28-Jan-08 5:32
followait28-Jan-08 5:32 
GeneralRe: GDI+ NOISE problem Pin
Iain Clarke, Warrior Programmer28-Jan-08 5:34
Iain Clarke, Warrior Programmer28-Jan-08 5:34 
GeneralRe: GDI+ NOISE problem Pin
followait28-Jan-08 5:46
followait28-Jan-08 5:46 
GeneralQuestion regarding exported C++ symbols/objects Pin
Lea Hayes28-Jan-08 4:24
Lea Hayes28-Jan-08 4:24 
GeneralSmart Card Service Problem Pin
Federico Milano28-Jan-08 2:28
Federico Milano28-Jan-08 2:28 
GeneralRe: Smart Card Service Problem Pin
Maxwell Chen28-Jan-08 3:25
Maxwell Chen28-Jan-08 3:25 
GeneralRe: Smart Card Service Problem Pin
Federico Milano28-Jan-08 3:39
Federico Milano28-Jan-08 3:39 
GeneralRe: Smart Card Service Problem Pin
Maxwell Chen28-Jan-08 4:13
Maxwell Chen28-Jan-08 4:13 
GeneralLinker Error 2005 Pin
quastman28-Jan-08 1:29
quastman28-Jan-08 1:29 
QuestionRe: Linker Error 2005 Pin
CPallini28-Jan-08 1:50
mveCPallini28-Jan-08 1:50 

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.