Witam! Piszę sobie od jakiegoś czasu pewien program. W tym momencie natknąłem się na problem. Program nie przechodzi do tego ifa:
else if(Command.substr(0,3).compare("top")==0){
if(IsTop){
color(10);
cout<<"TopMode Enabled!";
return;
}else{
color(12);
cout<<"TopMode Disabled!";
return;
}
string sub = trim(Command.substr(3, Command.length()-1));
if(sub.compare("top")){
HWND hwndMyWnd = FindWindow("ConsoleWindowClass", NULL);
::SetWindowPos(hwndMyWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
::ShowWindow(hwndMyWnd, SW_NORMAL);
IsTop=true;
CommandInterpreter("top");
return;
}
else if(sub.compare("untop")){
HWND hwndMyWnd = FindWindow("ConsoleWindowClass", NULL);
::SetWindowPos(hwndMyWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
::ShowWindow(hwndMyWnd, SW_NORMAL);
IsTop=false;
CommandInterpreter("top");
return;
}
}
Nie wchodzi mi do niego wgl. Command wygląda tak: "top". Więc nie kumam o co chodzi. Trim działa poprawnie.