|
Check out htmlfilter, this program filters out the commands that create popup windows, but I'm sure it wouldn't be hard to modify for what you need.
http://www.codeproject.com/tools/htmlfilter.asp?target=
|
|
|
|
|
I want to make a textcontrol object as in MSPaint..It should act as an object and must be movable and resizable...Please help me out.. ITS URGENT....
|
|
|
|
|
Hi,
I need to enumerate the process (names), that is running the current user on a terminal server (the user starts his terminal "client", then starts my application and I need to know if some processes are running or not).
I have tried to enumerate the processes names in a normal way, but then it gives me all the processes from all the sessions .
Thanks in advance, Greetings
Braulio
|
|
|
|
|
You can use WTSEnumerateProcesses(), which take WTS_PROCESS_INFO structure as one of its parameter.
where you can specify session id.
The session ID can be obtained from a variety of APIs including ProcessIdToSessionId, WTSQuerySessionInformation, or WTSEnumerateProcesses.
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
What is the particular problem with your program? Does it compile or is it a problem when running it?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've problems when compiling.I think it needs 1 or 2 changes but I couldn't find.Can someone please help to figure it out?
Thanks
|
|
|
|
|
I've tried to compile and it gives the following errors:
(31) : error C2001: newline in constant The expression while(k!='\'); is incorrect: remember \ inside a literal string is a escape character. Maybe you mean '\\' (single backslash) or '\'' (single quote).
(66) : error C2440: 'initializing' : cannot convert from 'char []' to 'char'
(68) : error C2440: '=' : cannot convert from 'char' to 'char []' These are obvious: temp is not the same type as str or str2 .
After these new errors will ensue: keep posting if you cannot handle them after some examination.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
The 'count()' function is correct. Your call
int keer=count(str,s);
is looking for the character stored on s.
I think you want
int keer=count(str,'s');
This will count the 's' characters in the string str. You can get rid of the in s variable unless you want to be able to change it in the future. If this is the case assign the character 's' to the variable s and leave the call alone
int s='s';
In the 'swap()' function you are copying the addresss of the string NOT the string. The local container should be an array large enough for the string and the strings should be copied NOT assigned. Check the standard 'C' function 'strcpy()'. Your call will need to pass the string sizes. If you are not using the string size parameters to 'swap()' you should dispense with them. The declaration and definition header would look like: void swap(char str[], char str2[]);. You have already made certain that they will fit in the allotted storage (60 characters or less). The code in the 'swap()' function should look something like:
char temp[61];
strcpy(temp, str);
strcpy(str, str2);
strcpy(str2, temp);
|
|
|
|
|
In addition to Joaquín's suggestions, you need to look at the swap() function. It is expecting 4 parameters, but is only being called with two. The count() function is expecting a char for a second parameter, but is being called with an int . It also needs to return a value. The sentence() function also needs to return a value.
None of this should come as a big surprise to you as the compiler should have told you what was wrong.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
For text handling in GDI.
How do I draw text from right to left? Normal text are from left to right.
thanks
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Use the following flag in your DrawText(...) call
DT_RTLREADING - Layout in right-to-left reading order for bi-directional text when the font selected into the hdc is a Hebrew or Arabic font. The default reading order for all text is left-to-right.
|
|
|
|
|
i have two dialog boxes dialog1 and dialog2.when i click on the ok button of dialog1 i wnat to display dialog2 window.how do i do it
|
|
|
|
|
Here ...
CDialog1 Dlg1;
if (IDOK == Dlg1.DoModal())
{
CDialog2 Dlg2;
Dlg2.DoModal();
}
Best regards,
Eugene Pustovoyt
|
|
|
|
|
in the button event handler of dialog 1,
do this
dialog2 dlg;
dlg.DoModal();
//you need to inlcude the header file of the dialo2
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Here sample of a code to gets a page through proxy with authorizing. First ::HttpSendRequest call returns success, but second call after proxy authorization is wedging. Why!? Where is mistake!?
HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;
DWORD dwError, dwStatus;
DWORD dwStatusSize = sizeof(dwStatus);
hOpenHandle = ::InternetOpen("Example", INTERNET_OPEN_TYPE_PROXY, strProxyName, NULL, 0);
if (NULL != hOpenHandle)
{
hConnectHandle = ::InternetConnect(hOpenHandle, "www.microsoft.com", INTERNET_INVALID_PORT_NUMBER, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
if (NULL != hConnectHandle)
{
hResourceHandle = ::HttpOpenRequest(hConnectHandle, "GET", "", HTTP_VERSION, NULL, 0, INTERNET_FLAG_DONT_CACHE, 0);
if (NULL != hResourceHandle)
{
resend:
BOOL bSendRequest = ::HttpSendRequest(hResourceHandle, NULL, 0, NULL, 0);
::HttpQueryInfo(hResourceHandle, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL);
switch (dwStatus)
{
case HTTP_STATUS_PROXY_AUTH_REQ:
InternetSetOption(hResourceHandle, INTERNET_OPTION_PROXY_USERNAME, (LPVOID)(LPCTSTR)strProxyUsername, strlen(strProxyUsername)+1);
InternetSetOption(hResourceHandle, INTERNET_OPTION_PROXY_PASSWORD, (LPVOID)(LPCTSTR)strProxyPassword, strlen(strProxyPassword)+1);
goto resend;
break;
case HTTP_STATUS_DENIED:
InternetSetOption(hResourceHandle, INTERNET_OPTION_PROXY_USERNAME, (LPVOID)(LPCTSTR)strProxyUsername, strlen(strProxyUsername)+1);
InternetSetOption(hResourceHandle, INTERNET_OPTION_PROXY_PASSWORD, (LPVOID)(LPCTSTR)strProxyPassword, strlen(strProxyPassword)+1);
goto resend;
break;
}
if (HTTP_STATUS_OK == dwStatus)
{
}
::InternetCloseHandle(hResourceHandle);
}
::InternetCloseHandle(hConnectHandle);
}
::InternetCloseHandle(hOpenHandle);
}
Best regards,
Eugene Pustovoyt
|
|
|
|
|
|
I am trying to click Sign Button Window of MSN messenger.But program is crashing at 2nd Sendmessage. This technique works fine with Yahoo messenger. Any suggestions?
{<br />
int iControl = GetDlgCtrlID(hWindow3);<br />
SendMessage(hWindow3,WM_SETFOCUS,iControl,(LPARAM)hWindow3);<br />
hSend = SendMessage(hWindow3,WM_LBUTTONDOWN, MK_LBUTTON,(LPARAM)1);<br />
hSend = SendMessage(hWindow3,WM_LBUTTONUP, 0,(LPARAM) 1);<br />
}
Cheers!!!
Siddharth
|
|
|
|
|
Did you try to replace the first sendmessage with postmessage, or commenting the first sendmessage then again is it craching? if so then there is a prob with 2nd sendmessage.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Not sure what exactly causes the crash,
but MSDN defines WM_SETFOCUS as :
wParam - Handle to the window that has lost the keyboard focus. This Parameter can be NULL. <br />
lParam - This parameter is not used.
Perhaps this is what causes the 'confusion' later...
Try simply calling the windows function SetFocus(HWND window);
|
|
|
|
|
If you are trying to Click a button
Why not try to send WM_COMMAND msg to the window with the ID of the button (you can discover it via GetDlgCtrlID() )
Hope it Helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
I have an app that's centered around a List-Control.
Over the area not occupied by the List-Control rest several buttons that affect this List-Control .
My minor problem is that whenever such a button is pressed, it grabs the focus away from the list which is something I don't want to happen.
I also have an edit-box which grabs the focus, but that's obviously ok.
What I'm looking for is a method to tell specific controls not to grab the focus yet still remain usable.
Thanks
|
|
|
|
|
Sounds like maybe you need to rethink the application. As a general rule I'd expect something I click on to grab the focus. It would feel counter-intuitive to work otherwise.
If, on the other hand, what you mean is that you want the ListControl to show the current selection even when it lacks focus you can do that by adding the LVS_SHOWSELALWAYS style to the ListControl.
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
These 'special' buttons are buttons which usually change the way the list appears, or buttons that trigger menus for example.
These two kinds of buttons are 'state changers' at most, when the user is done with them, he expects to see the selection (more on this at the end) and be able to scroll his mouse-wheel and have the list respond.
I'm already using LVS_SHOWSELALWAYS, but I draw the selection differently when the list is in focus and when it's not, so that the user knows that he's going to mouse-wheel he's going to affect the list (or not).
The most common situation is a button that switches the list's mode from details to icons, etc, etc. Once you click the button, it gains the focus and maintains it, causing the list to loose the focus. In such a case, the user would like the list to maintain the focus.
What do you think ?
|
|
|
|
|
It may be a horrible solution but why not throw focus back to the ListControl when one of the special buttons handles a click event?
[edit]Don't try to do this directly within the event handler. Define a custom message and handler and do a PostMessage to that handler from within the click event. Windows does strange things when trying to change focus from within a focus related event.[/edit]
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|