|
Your main thread is blocking on the WaitCommEvent.
Typically, code like this would be placed into a separate tread where it would not interfere with the processing of other information, such as mouse movements, painting, keyboard events, etc.
|
|
|
|
|
i already stored the name of the active window processes inside a listbox..how do i get to select and show the process that was selected?
about C++ and MFC
|
|
|
|
|
Hi,
Did you mean how to select Items from the list box?
Use CListBox::GetSel function to select the current item in the list box. If you want get all the item selected from list box, you get the total number of counts use GetCount function and check all the items is whether select or not
Regards
Selvam
|
|
|
|
|
nope..what i meant is that after selecting the particular name in the listbox, i would like open the corresponding application that coincides with the name...
i used enumwin() to get the running application process and store its name to the listbox...but how can i show the window that corresponds to the application name selected?
about C++ and MFC
|
|
|
|
|
While Enumeration of Window Store the Name of Window along with corresponding HWND or HANDLE.
when User select the Window to close just search the your local array for handle and send Close Message.
Hope you understand this
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks!but can i have a sample code of the array...here's how i stored the values
::enumwndfn(CWnd * wnd)
{CString s;
wnd->GetWindowText(s);
m_TaskList.AddString(s);
}
Bool CALLBACK CDlg::enumwndfn(HWND hWnd, LPARAM lParam)
{
CDlg* me = (CDlg *)lParam;
return me->enumwndfn(CWnd::FromHandle(hWnd));
}
called by : EnumWindows(enumwndfn, (LPARAM)this);
Thanks!
about C++ and MFC
|
|
|
|
|
Do this thing
I think you m_TaskList is type CStringArray change it to CPtrArray.
and Create a Struct
struct MyArry
{
CString WindowName;
CWnd Wnd;
};
and Instead
spiced wrote:
::enumwndfn(CWnd * wnd)
{CString s;
wnd->GetWindowText(s);
m_TaskList.AddString(s);
}
use this thing
::enumwndfn(CWnd * wnd)
{
CString s;
wnd->GetWindowText(s);
MyArry tmp;
tmp.WindowName=s;
tmp.Wnd=*wnd;
m_TaskList.add(tmp);
}
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
I developed an application in VC++, and it is crashing in the release mode.I enabled Debbuging in the release mode, and I hv attached the dump of my Call Stack.
I dont know, why CWinApp object is NULL.Can anybody pl. help me in solving this...
TBMS3! __sbh_free_block + 369 bytes
TBMS3! free + 35 bytes
operator delete(void * 0x0145c030) line 349 + 9 bytes
CPlex::FreeDataChain(CPlex * const 0x00000000) line 45 + 6 bytes
CMapPtrToPtr::RemoveAll(CMapPtrToPtr * const 0x00000000 {CMapPtrToPtr}) line 94
CHandleMap::DeleteTemp(CHandleMap * const 0x00000000) line 239 + 8 bytes
AfxUnlockTempMaps(int 1) line 50
CWinThread::OnIdle(CWinThread * const 0x00000000 {CWinThread h=??? proc=???}, long 5120804) line 591
CWinApp::OnIdle(CWinApp * const 0x00000000 {CWinApp ???}, long) line 494
Also, earlier it was giving errors related to vector destructor iterator.
Wherever I used delete [] ptr, the application was failing. Even though I am not using delete [] from within my code, the MFC framework is using that a lot. Is there any way by which I can force the compiler to include vector destructor, and scalar destructor.
I am working in VC++ 6.0
--Rgds--
|
|
|
|
|
|
Hello everybody!
First of all, thanks for your answer Blake Miller!!!
I didn´t explain the situation correctly.
I mixed up with the example!!
I´ll try to explain it correctly...
I´m using CreateProcess to create a new process, with the
CREATE_NEW_PROCESS_GROUP flag set in the argument "dwCreationFlags",
to create a new process group.
Let´s suppose that PROCESS_A creates a new process,
with CREATE_NEW_PROCESS_GROUP flag set. This new created
process (PROCESS_B) is the 1º process of the process group.
It´s true that both the 1º process of a process group and
the process group itself have the same ID. So the ID of
the process group and the PID of PROCESS_B are the same.
If the PROCESS_B creates a new process (PROCESS_C) with
CREATE_NEW_PROCESS_GROUP flag cleared, both PROCESS_B
and PROCESS_C will belong to the same group.
PROCESS_B knows the ID of its process group, as it´s
its own PID. But...
-How can PROCESS_C get the process group ID?
(without using IPC or passing it through command line
arguments)
-Is there any function which returns the process group ID
of the calling process?
Summing up...
I only what to know how to get the ID of the process
group, to which a process belongs.
Thanks and bye.
|
|
|
|
|
Hi all:
How can I get specific folder's sector position?
|
|
|
|
|
|
Thanks!But I'm not familiar with ASM, Is there any other language can implement that (c\c++)
|
|
|
|
|
Hi,
You may use ASPI or SPTI to read CD sector.
Scan TOC to locate specific folder descriptor ( see ISO 9660 ).
To send ASPI command you may use "SendASPI32Command" function from winaspi.dll, or use DeviceIOControl to send SPTI command.
Regards,
Slava.
|
|
|
|
|
void MyDialog::m_SetFont( )
{
if(0 == strcmp(g_szCurrLang, "English"))
{
m_stfontObj= (HFONT)GetFont();
}
else
{
/* curFont+=*g_szCurrLang;
curFont+=*g_szCurrKbd;*/
curFont+="UrduPhonetic";//name of the phont
}
if(m_stfontObj!=NULL)// || (0 == strcmp(g_szCurrLang, "English")))
{
}
else
{
CString strName_Font;
strName_Font=" "+curFont;//TO CONCATENATE THE Font name with the format
m_stfontObj = CreateFont(-40, 0, 0, 0, FW_DONTCARE,
FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE, LPCTSTR(curFont)); //strName_Font
CFont* my_pCurFont = CFont::FromHandle(m_stfontObj);
this->SetFont(my_pCurFont,TRUE);
CFont * my_fetchedfont =this->GetFont();
}
}
this is my fuction to get the font by name UrduPhonetic and then want to display the characters on the buttons with the font
and in my button class
i am writing as
void MybutCls::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
short b_caps=GetKeyState(VK_Caps);
short b_shift=0;//GetKeyState(16);
MyDialog *puclmydialogRef=NULL;
puclmydialogRef=(MyDialog*)GetParent();
SelectObject( lpDrawItemStruct->hDC,(((MyDialog*)GetParent())->GetFont())->m_hObject);//set the font handler to drawitem handler
//draws a frame control of the specified type and style.
::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem,DFC_BUTTON,DFCS_BUTTONPUSH|BS_DEFPUSHBUTTON);
if((0x8000 ==(0x8000 & GetKeyState(16))&& !b_caps))//||(0x8000 !=(0x8000 & GetKeyState(16))&& caps))
{
if(lpDrawItemStruct->CtlID==IDC_BUTTON49)
::DrawText(lpDrawItemStruct->hDC,"!",1,&lpDrawItemStruct->rcItem,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
if(lpDrawItemStruct->CtlID==IDC_BUTTON45)
::DrawText(lpDrawItemStruct->hDC,"_",1,&lpDrawItemStruct->rcItem,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
but its not displaying the symbol from the obtained font on my ownerdraw buttons but its jst displaying thestring which i give in the "" such as "!"
can any one help me
Its very urgent
|
|
|
|
|
Have you enabled Unicode Support!!
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
i am not using anything related to unicode support and where should i do that
|
|
|
|
|
As you say you have problem with Font : UrduPhonetic.
That why I said ENABLE UNICODE in you APP
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
It would be helpful if you could determine if none of the fonts work, or just the UrduPhonetic font. That would go a long way in isolating the problem to the code or the font. Is this a proprietary font, or one that can be freely downloaded?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hiii...
currently i am workin ona project which involves capturing the entire GUI of an appliaction....
the problem being encountered is tht i am not able to use the GETGUIRESOURCES function declared in the PSAPI.H header file....
i already hav the PSAPI.DLL in my system folder n the .lib file also...
wht is the solution to this?
how can i use the function?
|
|
|
|
|
Hi,
What is your problem ? could you post the error message?
Did you link with obj file in your linker properly.
Regards,
Selvam
|
|
|
|
|
hii....
thanx a lot for replyin...
actually evrythin's workin fine until the last step...
just get the error sayin tht UNDECLARED IDENTIFIER...
i hav a doubt tht ther may b some prob with my .lib file---is tht possible?
it wud b very kind of u to b in touch wid me coz the project i am workin on is really imp...
if i am unclear in my explanation then plz let me know...
n any help is most welcome n vil b added as a part of the acknowledgements received...
i vil try n send u the code portion as soon as possible...
thanking you...
|
|
|
|
|
Hello all,
although this question is not related to the forum's specifics, I'd like to ask it here because I hope to get some answers from users of a Revision Control System.
I need to switch from Visual Source Safe to a Revision Control System which allows me to:
1. access projects over the Internet
2. have tools to integrate Visual Studio 6 and Visual Studio .NET
3. have additional tools to allow me to maintain todo's / work progress and to create version-based reports of my team's work
For the first two needs, after a quick search, I've found that a Subversion server with it's plug'ins might do the job.
So, my questions are:
- is Subversion good enough or are there better alternatives?
- which SCC provider should I choose: Subway, SourceCross or AnkhSVN? AnkhSVN is only for Visual Studio .NET, so if I choose it I'll also need one of the first two for Visual Studio 6.
- are there any Visual Studio-integrated tools which work with Subversion to help me maintain the list of todo's / work progress and any external tools to allow me to crete version-based reports (something like:
v1.0
Bug #1 - Bug description - Status: Fixed
New Feature #1 - Feature description
etc.
Thanks.
Regards,
George Ionescu
|
|
|
|
|
Hi,
Is there anyway to query whether a file is on Network or the local drive... if possible... please this is really urgent!
lid
|
|
|
|
|
How about _access() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|