c++ - Need help using wincon.h file. (SetConsoleMode, SetConsoledisplaymode) -
so have project using windows.h header file, includes wincon.h header file , need 2 things. when program starts, need console go fullscreen without user having anything. ideas on that.
but main thing need how disable quick edit option , able use mouse input while being able input keyboard.
code @ moment.
void mode_mouse(){ setconsolemode(getstdhandle(std_input_handle), enable_insert_mode | enable_extended_flags); setconsolemode(getstdhandle(std_input_handle), enable_mouse_input); } void mode_kb(){ //? } bool option_mouse_detect0(){ mode_mouse(); for(int l=0;l<300;l++){ for(int l2=0;l2<300;l2++){ op_ma[l][l2]=0; } } for(int l=19;l<=23;l++){ for(int l2=13;l2<=41;l2++){ op_ma[l][l2]=1; } } for(int l=25;l<=29;l++){ for(int l2=13;l2<=41;l2++){ op_ma[l][l2]=2; } } for(int l=31;l<=35;l++){ for(int l2=13;l2<=41;l2++){ op_ma[l][l2]=3; } } input_record record; dword dw; while(1){ readconsoleinput(getstdhandle(std_input_handle), &record, 1, &dw); if(record.eventtype == mouse_event) { if(record.event.mouseevent.dwbuttonstate & from_left_1st_button_pressed) { switch(op_ma[record.event.mouseevent.dwmouseposition.y][record.event.mouseevent.dwmouseposition.x]){ case 1:{ if(!file_make()){ new_profile(); } isnew(); option_1(); break; } case 2:{ info(); main_screen(); break; } case 3:{ exit(0); break; } } } } } mode_kb(); }
i added entire code problem, sorry un-important code line.
the option_mouse_detect0 function detection of mouse. if mouse moved, test other things (like left click, instance) , run other functions if mouse in right position. (also, after other functions ran, run mode_kb function). need code put in mode_kb allow me input keyboard (for reason, enter key inputted). tried modes there in setconsolemode function, none allow me keyboard input after use setconsolemode(handle,enable_mouse_input). please advise. thanks.
Comments
Post a Comment