Click here to Skip to main content
15,897,968 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPragmatically click a CListCtrl row Pin
Snakebyte22-Apr-03 1:55
Snakebyte22-Apr-03 1:55 
GeneralAudio file information Pin
viliam22-Apr-03 1:34
viliam22-Apr-03 1:34 
GeneralRe: Audio file information Pin
RaajaOfSelf22-Apr-03 2:08
RaajaOfSelf22-Apr-03 2:08 
GeneralHELP in ACCESS DATABASE Pin
RaajaOfSelf22-Apr-03 1:25
RaajaOfSelf22-Apr-03 1:25 
QuestionSAPI 5.0, how do I select other languages? Pin
Joan M22-Apr-03 0:31
professionalJoan M22-Apr-03 0:31 
GeneralHelp VC6 linker! Pin
Zoltan22-Apr-03 0:04
Zoltan22-Apr-03 0:04 
GeneralRe: Help VC6 linker! Pin
Neville Franks22-Apr-03 0:59
Neville Franks22-Apr-03 0:59 
Generalabout SetThreadDesktop Pin
lin_li_00021-Apr-03 22:40
lin_li_00021-Apr-03 22:40 
please help me how can i do ! WTF | :WTF: WTF | :WTF: WTF | :WTF:

first i create my new desktop, then open the window station with the name "winsta0", the next step SetProcessWindowStation and SetThreadDesktop are called, but when i call SetThreadDesktop an error occurs, the error number is 170 .

following is the function code(i call this function before showing the main window):

void CEnumDesktopApp::SetMyDesktop(void)
{
hDesktopCurrent = NULL;
hDesktopCurrent = GetThreadDesktop(GetCurrentThreadId());

hDeskDefault = NULL;
hDeskDefault = OpenDesktop("default", 0, FALSE,
DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |
DESKTOP_JOURNALPLAYBACK |
DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP |
DESKTOP_WRITEOBJECTS);
if (hDeskDefault == NULL)
{
return ;
}

hDesktopLlx = NULL;
hDesktopLlx = OpenDesktop("llx", 0, FALSE,
DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |
DESKTOP_JOURNALPLAYBACK |
DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP |
DESKTOP_WRITEOBJECTS);
if (hDesktopLlx == NULL)
{
SECURITY_ATTRIBUTES sa;
sa.bInheritHandle = TRUE;
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;

hDesktopLlx = CreateDesktop("llx", NULL, NULL, DF_ALLOWOTHERACCOUNTHOOK,
DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |
DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |
DESKTOP_JOURNALPLAYBACK |
DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS |
DESKTOP_SWITCHDESKTOP |
DESKTOP_WRITEOBJECTS,
&sa);
if(hDesktopLlx == NULL)
{
AfxMessageBox("create desktop failed!");
return ;
}
}

HWINSTA hwinsta = NULL;
hwinsta = OpenWindowStation("winsta0", FALSE,
WINSTA_ACCESSCLIPBOARD |
WINSTA_ACCESSGLOBALATOMS |
WINSTA_CREATEDESKTOP |
WINSTA_ENUMDESKTOPS |
WINSTA_ENUMERATE |
WINSTA_EXITWINDOWS |
WINSTA_READATTRIBUTES |
WINSTA_READSCREEN |
WINSTA_WRITEATTRIBUTES);
if (hwinsta == NULL)
{
return ;
}

if (!SetProcessWindowStation(hwinsta))
{
return ;
}
if(!SetThreadDesktop(hDesktopLlx))
{
char szError[256] = {0};
ltoa( (long)(GetLastError()) , szError, 10);
AfxMessageBox(szError);
}

SwitchDesktop(hDesktopLlx);
}
QuestionHow to give a run time struct definition Pin
gumber21-Apr-03 22:38
gumber21-Apr-03 22:38 
AnswerRe: How to give a run time struct definition Pin
Phil Hamer22-Apr-03 12:57
Phil Hamer22-Apr-03 12:57 
GeneralRe: how to input a xml file in vc++ project ? Pin
Joaquín M López Muñoz21-Apr-03 22:29
Joaquín M López Muñoz21-Apr-03 22:29 
Generaltvn_selchanging message Pin
JensB21-Apr-03 21:31
JensB21-Apr-03 21:31 
GeneralRe: tvn_selchanging message Pin
Phil Hamer22-Apr-03 13:00
Phil Hamer22-Apr-03 13:00 
GeneralBrodcast a message when settings are changed Pin
Mathias S.21-Apr-03 21:28
Mathias S.21-Apr-03 21:28 
GeneralRe: Brodcast a message when settings are changed Pin
David Crow22-Apr-03 5:30
David Crow22-Apr-03 5:30 
QuestionHow to send CString with SendMessage Pin
Vassili21-Apr-03 20:57
Vassili21-Apr-03 20:57 
AnswerRe: How to send CString with SendMessage Pin
puzzolino21-Apr-03 21:12
puzzolino21-Apr-03 21:12 
AnswerRe: How to send CString with SendMessage Pin
John R. Shaw22-Apr-03 17:22
John R. Shaw22-Apr-03 17:22 
GeneralHp openview Pin
zhixiong21-Apr-03 20:42
zhixiong21-Apr-03 20:42 
GeneralDebugging.. Pin
vikramlinux21-Apr-03 20:37
vikramlinux21-Apr-03 20:37 
GeneralUTF-8 Conversion Pin
vikramj21-Apr-03 20:11
vikramj21-Apr-03 20:11 
GeneralWant to write a tool to analyze log file of IIS. Pin
George221-Apr-03 19:41
George221-Apr-03 19:41 
GeneralEnabling Menu Items Pin
AnkushChopra21-Apr-03 19:14
AnkushChopra21-Apr-03 19:14 
GeneralRe: Enabling Menu Items Pin
21-Apr-03 20:07
suss21-Apr-03 20:07 
GeneralRe: Enabling Menu Items Pin
AnkushChopra23-Apr-03 22:16
AnkushChopra23-Apr-03 22:16 

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.