|
How can i get a filename from url that is not explicitly include filename.
E.g from http://www.microsoft.com/anypage/anypage.asp?hg=987&k=9792
I would like to get filename like abc.exe.
Thanks.
itblue
|
|
|
|
|
One solution is to do a search for *.exe on data the server sends back.
Kuphryn
|
|
|
|
|
It is difficult to get a filename when folder name or file extension is not known.
Is there another solution?
thanks.
|
|
|
|
|
Not sure what you mean. You want to get a filename from a URL that doesn't contain a filename?
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Check out the UrlGetPart API. I'm not sure it does what you want but you might try to use it and/or PathFindFileName. Then again, if you are using ATL7 that ships with Visual Studio.NET you have the CUrl class that almost certainly can do what you want.
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
i have both Lparam and Param of a perticuler message
that might be keborad message i also have a hwnd of an edit box.
how to get a key message (that is in lparam and param)into an edit box using postmessage method?
r00d0034@yahoo.com
|
|
|
|
|
Hi I am using the legacy concept to copy stuff into the clipboard and it works fine. The problem is that when I want to copy for example 5 line of text, I just concatenate them together with '\n' between them into the buffer of the clipboard.
Sounds nice, yes, and it also works for pasting into Word for example, but when I try to paste into Notepad, it comes as one long line, why doesn't it recognize the '\n' ?
Any idea or suggestion ?
PS
I tried adding 0xa and 0xc between and no help
|
|
|
|
|
You Notepad you will need CR LF. ie. 0x0xd 0x0a or \r\n
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
i have an edit box HWND.
i want to send a message of a keydown for example U
and u (key)is typed into edit box ?
can any body tell using postmessage example with its correct parameters?
r00d0034@yahoo.com
|
|
|
|
|
The messages sent are WM_KEYDOWN, WM_CHAR and WM_KEYUP. I don't know if sending WM_KEYDOWN causes WM_CHAR to occur, I believe it does. You should look up those messages in the MSDN and try to create an LPARAM and WPARAM that match the values in the documentation, and see what happens.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
lets i have both lparam and param and hwnd of edit box then how to send message?
can u tell the correct parameters of postmessage ?
r00d0034@yahoo.com
|
|
|
|
|
I'm confused - do you realise that msdn.microsoft.com has the answer ? ::SendMessage ( from memory ) takes the HWND, the message, the LPARAM and the WPARAM, so it's
::SendMessage(MyHWND, WM_KEYDOWN, MyLParam, MyWParam);\
I presume PostMessage takes the same.
We had a big discussion in the lounge the other day about people who seem unwilling to do any research for themselves. I'd recommend in future you look up some online resources before asking basic questions. Both I and many other people here are always happy to help, but might I suggest it would be good for your personal growth to try to find out for yourself before asking questions that would take 30 seconds on the MSDN site to answer ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
thanks for advise.
but i have seen that thing many time.i am developing project.
first of all i recorded messages of keboard and mouse and after recording i was replaying the same events.i have no problem by posting mouse messages but i have problem with keboard messages.
i have both lparam and wparam but i have to store it first for that purpose i typecast it into int32 lparam and int32 wparam that is why E_to_Match->lparam is int32.
In if condition mouse messages work correctely where E_to_Match->message is also int32 but let me tell you how i get message in it
LPEVENTMSG lpEvent= (LPEVENTMSG)lParam;
E_to_Match->message=(int32)lpEvent->message;
in the same way i have stroed lparam and wparam.
plz see that code.
><
if(E_to_Match->message==WM_LBUTTONUP)
{
::SetCursorPos(fp.x,fp.y);
PostMessage(h,WM_LBUTTONDOWN,0,0);
PostMessage(h,WM_LBUTTONDOWN,0,0);
::Sleep(500);
PostMessage(h,E_to_Match->message,0,0);
}else
{
::Sleep(2000);
PostMessage(h,E_to_Match->message,(WPARAM)E_to_Match->wParam,(LPARAM)E_to_Match->lparam);
}
else condition dont work when that postmessage line executed i dont know why but one thing i know that the following line display 777 into that editbox (of hwnd h).
thats mean mine hwnd is correct.
PostMessage(h,E_to_Match->message,103,(LPARAM)E_to_Match->lParam);
now plz tell i will be very thankful i am also trying my best effort too.
r00d0034@yahoo.com
|
|
|
|
|
I have two dialog bars in a CFrameWnd derived class.
Each of the dialogbars have child controls. Is it possible to set a taborder through both the dialog bars? ie, tab on last of dlg1 goes to first of dlg2; and tab on last of dlg2 goes to first of dlg1.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Try to override PreTranslateMessage and do the right thing when VK_TAB is pressed and focus in on last control in dialog bar.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
I have a PropertySheet an some propertypages, the problem is that when i click in one of the propertypages (and only this one , lets call it "bad one"), it disappears.
No Error , no crash,nothing ,it just disappears.
This is only in the win98, it the win200 and winXP it runs ok.
When the propertysheet is created , all the propertypages are created and including the "bad one" , if even runs the "bad one::contructor".
But when I click on it , it does not run the "bad one::OnInitDialog".
one more strange thing is that it runs the destructor.
Any one of you had a problem like this??
Any hints?
_______________________________
Portal Imoguia Software Imoguia
MSN:maxsnts@hotmail.com
|
|
|
|
|
It may be a control which of non-registered Windows' class. Make a backup copy of your property page and remove controls one by one. Start with nonstandard ones, if they are there.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
thanks,
it was a richedit control. i have updated the dll in the Win98 and it works
_______________________________
Portal Imoguia Software Imoguia
MSN:maxsnts@hotmail.com
|
|
|
|
|
I've spent most of today trying to get double buffering working in a dialog box.
I know the theory behind it, create an area in memory - draw to that then copy that to the display....
I've tried using other peoples code which all seems to be aimed at the OnDraw() handler with its CDC object, but in OnPaint() you've got to create your own CDC.
This is the core of the code from my OnPaint handler, there's an OnTimer event that Invalidates() the display very quickly so it's flickering like mad.
AFAIKTell it's right, I create a compatible CDC, assign a bitmap to it, draw on that then BitBlt it to the main CPaintDC.
Can anyone please help me out, I'm nearly in tears here. :-/
// Get the size of the client rectangle.
CRect cr;
GetClientRect(&cr);
int m_nDisplayWidth = cr.Width();
int m_nDisplayHeight = cr.Height();
CPaintDC dc(this); // device context for painting
CBitmap bmp, *poldbmp;
CDC memdc;
int bitplanes = dc.GetDeviceCaps(PLANES);
int bitspixel = dc.GetDeviceCaps(BITSPIXEL);
bmp.CreateBitmap(m_nDisplayWidth, m_nDisplayHeight, bitplanes, bitspixel, NULL);
memdc.CreateCompatibleDC( &dc );
poldbmp = memdc.SelectObject( &bmp);
COLORREF col;
int sp;
CPoint s;
for(int i = 0; i < m_nNumStars; i++){
sp = 255;
col = RGB(sp,sp,sp);
s.x = rand() % m_nDisplayWidth;
s.y = rand() % m_nDisplayHeight;
memdc.SetPixel(s, col );
}
dc.BitBlt(0,0, m_nDisplayWidth, m_nDisplayHeight, &memdc, 0,0, SRCCOPY);
memdc.SelectObject(poldbmp);
|
|
|
|
|
David_Jenkins wrote:
bmp.CreateBitmap(m_nDisplayWidth, m_nDisplayHeight, bitplanes, bitspixel, NULL);
try CreateCompatibleBitmap. otherwise, the code looks ok.
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
Keith Rules CMemDC should work inside OnPaint() ...
Are you returning FALSE inside of OnEraseBkgnd() so you avoid redrawing the screen...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
As Chris said earlier I would use CreateCompatibleBitmap to create your bitmap compatible to the paint DC.
I also wanted to add, you could add the MemoryDC and your bitmap as a member variable to your window class and keep that around as long as your window exists, or at least is visible.
That way you would not have to recreate and initialize the memoryDC and bitmap for each paint message. There are a lot of them, and you would probably see an increase in your paint speed this way.
This would also make it possible for your update routine to paint to the backbuffer bitmap that you are creating and you could then have the bitmap blitted to the screen in your OnEraseBackground handler. This would move all of the code from your OnPaint handler BTW.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanks guys but...
When I tried using CreateCompatibleBitmap I got a monochrome bitmap for some reason, I might look into that again later though.
Hockey suggested it might be my OnEraseBkgnd, I had to manually add the OnEraseBackground handler and force it to return FALSE but it didn't alter anything.
BUT his idea did put me on the right track, in my OnTimer even I was calling Invalidate() instead of Invalidate(FALSE).
I already made the other suggestions you made earlier today, storing memDC and bitmap as member variables.
I have one more question though.
Back in the old days when I was using one of the Gnu C compilers instead of bitblitting the backbuffer to the front buffer I'd just swap them round.
So the backbuffer became the screens bitmap and the screens bitmap became the backbuffer for the next drawing cycle.
I've had a quick go at it but it doesn't work. :-/
Like using this instead of a dc.bitblt() statement.
if(usingBack){
dc.SelectObject(backBuffer);
usingBack = false;
}else{
dc.SelectObject(originalBuffer);
usingBack = true;
}
I have a funny feeling it's just not possible to do that though.
Damn I just realised I wasn't selecting the alternative bitmap into the memDC so it'd draw onto that, I'll have to go and do some more work on this...
|
|
|
|
|
David_Jenkins wrote:
So the backbuffer became the screens bitmap and the screens bitmap became the backbuffer for the next drawing cycle.
You cannot select a bitmap into a window DC, that is why that does not work, although it would be cool.
Anyway, when you use CreateCompatibleBitmap, you need to use the WindowDC when you are creating a CompatibleBitmap. That is because right after you create your MEMDC, its bit plane depth is set to 1, and if you use that DC, your bitmap will be set to 1 as well. So the process to create a good bitmap and memdc is this:
<br />
CPaintDC dc;<br />
<br />
CBitmap bitmap;<br />
bitmap.CreateCompatibleBitmap(dc);<br />
<br />
CDC memDC;<br />
memDC.CreateCompatibleDC(dc);<br />
memDC.SelectObject(bitmap);<br />
I may not have the syntax or all of the paramaters correct, but you will need to do something relatively close to this.
By moving all of your painting code to the OnEraseBkgnd handler, you will be able to free your paint routine to only do special add on painting that cannot or should not be placed into your cached bitmap.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Nice one, Thanks Paul!!
Switching to using the CreateCompatibleBitmap has increased the speed of the BitBlt function, I assume previously it was having to convert the one I made into one compatible with the windows bitmap thus slowing it down drastically.
Thanks again!
|
|
|
|
|