Click here to Skip to main content
15,033,418 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: How to remove a non-ascii character from CString Pin
phil.o1-Jan-20 14:56
mvephil.o1-Jan-20 14:56 
AnswerRe: How to remove a non-ascii character from CString Pin
Eddy Vluggen1-Jan-20 13:30
professionalEddy Vluggen1-Jan-20 13:30 
GeneralRe: How to remove a non-ascii character from CString Pin
phil.o1-Jan-20 14:56
mvephil.o1-Jan-20 14:56 
GeneralRe: How to remove a non-ascii character from CString Pin
Eddy Vluggen1-Jan-20 15:55
professionalEddy Vluggen1-Jan-20 15:55 
QuestionC++ control textBox of Form1 and Form2 Pin
HeeMongKorea29-Dec-19 20:07
professionalHeeMongKorea29-Dec-19 20:07 
AnswerRe: C++ control textBox of Form1 and Form2 Pin
Richard MacCutchan29-Dec-19 22:05
mveRichard MacCutchan29-Dec-19 22:05 
GeneralRe: C++ control textBox of Form1 and Form2 Pin
HeeMongKorea16-Jan-20 0:29
professionalHeeMongKorea16-Jan-20 0:29 
Questionwidows api setwindowpos with SWP_HIDEWINDOW not always works Pin
viewlucc28-Nov-19 14:04
Memberviewlucc28-Nov-19 14:04 
int cpp_ptysetpg(unsigned long iProc)
{
HANDLE stdFds[3];
HWND hWnd;
DWORD wndPId;
int vRlt = 0;
WINDOWINFO vInfo;
hWnd = GetTopWindow(NULL);
unsigned long vProc = GetCurrentProcessId();
iProc = vProc;
assert(vProc == iProc);
while (hWnd != NULL)
{
GetWindowThreadProcessId(hWnd, &wndPId);
if (iProc == wndPId) break;
hWnd = GetNextWindow(hWnd, GW_HWNDNEXT);
}

vRlt = SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_NOACTIVATE| SWP_HIDEWINDOW);
ShowWindow(hWnd, SW_HIDE);

/* save the current standard handles */
stdFds[0] = GetStdHandle(STD_INPUT_HANDLE);
stdFds[1] = GetStdHandle(STD_OUTPUT_HANDLE);
stdFds[2] = GetStdHandle(STD_ERROR_HANDLE);

FreeConsole();
if (AllocConsole())
SetConsoleCtrlHandler((PHANDLER_ROUTINE)myhdlr, TRUE);

/* restore the standard handles */
SetStdHandle(STD_INPUT_HANDLE, stdFds[0]);
SetStdHandle(STD_OUTPUT_HANDLE, stdFds[1]);
SetStdHandle(STD_ERROR_HANDLE, stdFds[2]);

hWnd = GetTopWindow(NULL);
while (hWnd != NULL)
{
GetWindowThreadProcessId(hWnd, &wndPId);
if (iProc == wndPId) break;
hWnd = GetNextWindow(hWnd, GW_HWNDNEXT);
}
int test = 0;
if (test)
SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_NOACTIVATE | SWP_HIDEWINDOW);
else
{
vRlt = SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_NOACTIVATE);
assert(vRlt != 0);
vRlt = SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_HIDEWINDOW);//second call not always work
assert(vRlt != 0);
}
vRlt = GetWindowInfo(hWnd, &vInfo);
assert(vRlt != 0);
if (vInfo.dwStyle&WS_VISIBLE)
{
assert(0);
ShowWindow(hWnd, SW_HIDE);
}
vRlt = GetWindowInfo(hWnd, &vInfo);
assert(vRlt != 0);
if (vInfo.dwStyle&WS_VISIBLE)
assert(0);

return (0);
}

The second call (inside if(test) xx; else{ }) of SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_NOACTIVATE) and SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 1, 1, SWP_HIDEWINDOW) does not always work. At least 1 of 10 times running of this function the window is still visible. However it always works with
SWP_NOACTIVATE|SWP_HIDEWINDOW
. Why?
QuestionCan Someone please convert this from C++ to C? Topic : "Placement of Signal Boosters Using Tree Data Structures." Pin
ManojMaheshPatil15-Nov-19 22:35
MemberManojMaheshPatil15-Nov-19 22:35 
AnswerRe: Can Someone please convert this from C++ to C? Topic : "Placement of Signal Boosters Using Tree Data Structures." Pin
Dave Kreskowiak16-Nov-19 4:59
mveDave Kreskowiak16-Nov-19 4:59 
QuestionGenerate the equivalent of a DLL: a .netmodule Pin
Wim Hoeks16-Sep-19 9:28
MemberWim Hoeks16-Sep-19 9:28 
Questionprogramming an SDI drawing application with MFC in VC++ Pin
Member 1449477212-Sep-19 5:01
MemberMember 1449477212-Sep-19 5:01 
AnswerRe: programming an SDI drawing application with MFC in VC++ Pin
Richard MacCutchan12-Sep-19 5:07
mveRichard MacCutchan12-Sep-19 5:07 
GeneralRe: programming an SDI drawing application with MFC in VC++ Pin
Member 1449477212-Sep-19 5:21
MemberMember 1449477212-Sep-19 5:21 
GeneralRe: programming an SDI drawing application with MFC in VC++ Pin
Member 1449477212-Sep-19 6:48
MemberMember 1449477212-Sep-19 6:48 
GeneralRe: programming an SDI drawing application with MFC in VC++ Pin
Richard MacCutchan12-Sep-19 6:51
mveRichard MacCutchan12-Sep-19 6:51 
Questionadd prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
TH_Raksdsks9-Sep-19 19:30
MemberTH_Raksdsks9-Sep-19 19:30 
AnswerRe: add prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
OriginalGriff9-Sep-19 19:36
mveOriginalGriff9-Sep-19 19:36 
GeneralRe: add prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
TH_Raksdsks9-Sep-19 20:33
MemberTH_Raksdsks9-Sep-19 20:33 
GeneralRe: add prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
OriginalGriff9-Sep-19 21:28
mveOriginalGriff9-Sep-19 21:28 
GeneralRe: add prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
TH_Raksdsks10-Sep-19 2:14
MemberTH_Raksdsks10-Sep-19 2:14 
GeneralRe: add prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
OriginalGriff10-Sep-19 2:24
mveOriginalGriff10-Sep-19 2:24 
GeneralRe: add prerequisites and vcredistributable package to mfc setup application in vs2010 Pin
TH_Raksdsks16-Sep-19 23:20
MemberTH_Raksdsks16-Sep-19 23:20 
GeneralMessage Closed Pin
7-Oct-19 21:50
MemberMember 146157057-Oct-19 21:50 
QuestionHow to write a application for auto detect new HDD on windows 10 Pin
unitedcamau201915-Jul-19 17:23
Memberunitedcamau201915-Jul-19 17:23 

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.