|
i just can send the HTTP Request, but how do i tell Internet Explorer (i mean i need a new Internet Explorer Window, not a window which is part of my application) to receive the Request?
So, i need to open a new Internet Explorer window and the user is in the member area of the website i opened
how can i handle the http request/responses to do that?
thx
|
|
|
|
|
Ah. I misunderstood your question - sorry.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The problem is almost cetainly because the site is expecting a POST of the username and password, which can't just be stuffed on the end of the URL.
A post looks something like this (the exact names of the fields USERNAME and PASSWORD could maybe be determined by viewing the source of your particular web page).
POST /logon HTTP/1.1
Host: peer200:6002
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://peer200:6002/logon
Content-Type: application/x-www-form-urlencoded
Content-Length: 54
USERNAME=Administrator&PASSWORD=xxxxxxxx&SUBMIT=SUBMIT
Thanks,
Neil Humphreys.
|
|
|
|
|
What I want to do sounds quite simple. I'm firing off a new process from my application, and want to be able to set the color of the new process windows' top-bar (where the title and the minimize/maximise/close buttons are) from my process.
I've spent weeks combing the MSDN docs to do this, with no luck.
The closest I've found is the SetSysColors which allows me to set the topbar color, but for the whole system. Is there an equivalent function that takes in a hwnd handle? Alternately, what are my options? From my research it seems like I could hijack the messaging events to the window, and fudge the paint callbacks, but that seems way too drastic. I've found plenty of functions to move windows around, change the title text, etc... Are there any to control the color?
Thanks in advance.
|
|
|
|
|
The only thing that I can think to do here is API hooking, you can hook the GetSysColors function for that application and return the values you want. I don't know if this will work for the top level window or not, but probably. It still seems like a bit of work, but there are reasons this stuff is done at the global level, users should be able to set their colors to whatever they want and not have applications changing them.
-- Rocky Dean Pulley
|
|
|
|
|
an app (A) create a sub-process (B) and they communicate each other.
A uses ReadFile() in threads to read stdout and stderr from B.
but function ReadFile() blocks there even B was terminated.
is it just this way or something wrong?
how to solve the problem?
thx
includeh10
|
|
|
|
|
my app retrieves a file path from command line by double-clicking the file in Windows explorer.
Unfortunately, the file path is in 8.3 format.
my questions:
1) how to pass full-path to app when double-clicking the file? e.g. set register in other ways.
2) if 1) is impossible, how to change 8.3 format to full-path? as i tested, the function GetFullPathName() still returns a 8.3 path.
thx
includeh10
|
|
|
|
|
Have you looked at GetLongPathName() and GetShortPathName()
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
hi,
thx.
i don't know the function.
i read vc doc for it, vc doc says the function works for win98 and above, but our target is for all windows (incl. 95) - this is company's policy.
any other solutions?
(modify: it works very well on Win98)
includeh10
|
|
|
|
|
I'm curious why your program would care whether it was 8.3 or LFN. Most file I/O functions will work with LFN and all of them will work with 8.3 format.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You should wrap the %1 in the registration data in quote marks. You should also put your program's path in quote marks. For example:
"C:\Program Files\IncludeProg\MyProgName.exe" "%1"
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
that is why i got the trouble.
u sure it passes full-path to app other than 8.3 format?
includeh10
|
|
|
|
|
Hello,
I have a GUI application where the user can set the background color for a plotting control.
My question is how to select a foreground(text) color that will "contrast" with the user selected background?
COLORREF bg = GetUserPlotColor();
COLORREF fg = F(bg);
That is, what is the code for the F() body?
TIA.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
I'm no colour expert, but I did encounter this while writing a custom-drawn tree control a while back.
Have a look at this[^] article that should point you in the right direction.
However, in the end I think I settled for a simple XOR technique, where I XOR'ed my selection colour with white (#FFFFFF), to get the corresponding contrasting text colour. This is definitely the easy route, and will probably give unsatisfactory results on certain colours, but it works for me.
By the way, I found this[^] little web applet useful.
I Dream of Absolute Zero
|
|
|
|
|
I have played around a bit with inverting frame-grabbed images, and I found that the XOR technique usually works nicely.
Where it will not work well is with grey-scales which are close to mid-range, for example, if you have RGB-15 (5-bits of each colour, high order bit unused), where the R, G, and B values are all half-range = 15 decimal, i.e. the pixel is 0011 1101 1110 1111, XORing will give 1100 0010 0001 0000, i.e R, G, and B are all 10000 binary = 16 decimal.
For cases like this, the XORed text will be very difficult to make out.
To get around this, you could saturate (force to maximum or minimum) each colour component, then XOR / invert the result. For my example, the 15 decimal component values are forced to 0, then inverted to give 11111 binary, which should be visible.
|
|
|
|
|
This is an old function that generated a suitable shadow color for drawing 3D elements. If you reverese it, it should do what you want:
COLORREF MakeShadowColor(COLORREF rgbColor)
{
COLORREF rgbRetval;
if (rgbColor == RGB(255,255,128))
{
rgbRetval = RGB(128,128,0);
}
else if (rgbColor == RGB(192,192,192))
{
rgbRetval = RGB(128,128,128);
}
else if (rgbColor == RGB(128,255,255))
{
rgbRetval = RGB(0,0,255);
}
else if (rgbColor == RGB(0,0,0))
{
rgbRetval = RGB(128,128,128);
}
else
{
short iR = (GetRValue(rgbColor)+1)/2;
short iG = (GetGValue(rgbColor)+1)/2;
short iB = (GetBValue(rgbColor)+1)/2;
rgbRetval = RGB(iR,iG,iB);
}
return rgbRetval;
}
<pre>
<span style="background-color: rgba(255, 255, 0, 1); color: rgba(0, 128, 0, 1); font-family: Verdana, Arial; font-size: 8pt; font-style: italic"> onwards and upwards... </span>
|
|
|
|
|
Firstly I'd like to say that English is not my native language, so don't be angry with my mistakes.
I have a following problem.
I have writen program in c++ and now I'm working on making GUI. I do MFC Dialog based application. The problem is with edit box. My program do lots of iteration (~20.000). After each iteration I want to have printed number of iteration and values of some variables. this way in multiline edit box i want to have some kind of raport. I maneged to do it but i think my solution is not optimal and proper. i have simply added CString variable to EditBox and in each iteration I add temporary String refering to current iteration to whole string variable. It looks like this:
/*CString mWholeString
CString mTmpString -these are examle variables*/
mWholeString+=mTmpString;
and after finishing all interation i do UpdatData(FALSE).
It works but I think that it works slowly and there may be batter solution. Is this possible to print text like in console application e.g. create array of CString and print it in edit box using for loop?
I thank in advance for any direction.
|
|
|
|
|
You could possibly write your own output window. If you don't need editing of it, this would be a good solution that you could make run a lot faster. Just inherit directly from CWnd or CView and use the CDC::TextOut function.
-- Rocky Dean Pulley
|
|
|
|
|
This is probably going to be a tad better solution.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
Hi
Is it possible to call a c# dll from an unmanaged code writen using VC 7?
Thanks in advance.
|
|
|
|
|
If you register the DLL with COM, yes: you can use #import in C++ to import the type library generated by regasm .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Can you point me some article/tutorial that explain how to do this?
Thanks.
|
|
|
|
|
Hi
I have a control that can either be created dynamically (using CWnd::Create()) or is created directly by windows when placed on a dialog using the dialog editor.
In both cases PreSubclassWindow is called by the framework, which I then use to initialize the control. I don't use OnCreate to do the intialization as OnCreate is not called when the control sits inside a dialog. My Initialzation function which is called from PreSubclassWindow creates other child controls used by my control. Everything works out well when the control is created as part of a dialog control, but everything seems to fall apart when creating my control dynamically using CMyControl::Create(...);
Having stepped through the creation code, windows always calls CWnd::Attach twice when creating dynamically, with the second call to Attach causing the debug assertion as the controls window is already attached the first time around.
Anyone got any ideas about whats going here whith a pssible solution?
Thanks
Garth
|
|
|
|
|
Hi Garth
The question you pose is an interesting one. In fact all the questions you've asked are quite amazing. You're either incredibly clever or supremely (?) stupid as no one on this forum has ever answered you're questions. Anyway let me have a crack at it.
Create a method, call it say, Initialize() which creates all the child windows etc.
Override Create a method CMyControl::Create() which clients must call when creating your control dynamically. Add a BOOL property (member variable) to the control, call it say 'm_bIsDynCreate', and set it to FALSE in constructor of the control. Now in your custom Create() function, set this variable to TRUE, call the base Create method e.g. CWnd::Create(...) and then call your intialize method. In your Overriden PreSubclass method, test 'm_bIsDynCreate'. If it is FALSE, call Initialize(..), otherwise don't, as it will have already been called when creating the control dynamically. When called as part of the creating cycle of a dialog, it will be called in PreSubclass window.
Here is some source code for your perusal.
<br />
BOOL CGarthsCtrl::Create(const RECT & rect,CWnd* pParentWnd,UINT nID,DWORD dwStyle)<br />
{<br />
m_bIsDynCreate=TRUE;<br />
if(!CWnd::Create("GARTHSCTRL",NULL,dwStyle|CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW,rect,pParentWnd,nID))<br />
return FALSE;<br />
Initialize();<br />
<br />
return TRUE;<br />
<br />
}<br />
<br />
void CGarthsCtrl::PreSubclassWindow()<br />
{<br />
CWnd::PreSubclassWindow();<br />
if(m_bIsDynCreate==FALSE)<br />
Initialize();<br />
<br />
}<br />
Funnily enough, Garth, I was experiencing just the same problem this afternoon. Talk about coincidences.
Anyway I hope this helps you somewhat.
Regards
Garth
|
|
|
|
|