|
hcygxr2008 wrote: something has blocked me
Whats your excat problem?..
hcygxr2008 wrote: How can I use WM_MOUSEMOVE to move a bitmap in a splitted window,from left one to right one?
Seems you want to draw a bitmap from left pane (left side view) to right pane under some condition ( WM_MOUSEMOVE ). To do this, you have to notify the appropriate pane to draw the bitmap( custom messages will do ).
If you want to remove the bitmap in the current pane then you have repaint the pane.
Make sure both the panes have the bitmap detail.
Hope i understood your question...
Do your Duty and Don't expect the Result
|
|
|
|
|
Thank you very much! Firstly,you understood my question,But I can't understand your reply. Maybe I am poor,then,can you give me a example or just a segment of code.Thank you!!
|
|
|
|
|
Hope you know what is a custom message, if not refer SendMessage and PostMessage.
You will have a bitmap to draw, so notify the other pane to draw this bitmap if your condition met, you can use GetPane(..) API of splitter control class to get the appropriate window and send custom messages to that window,say hWnd is the handle to the window, that you have to paint the bitmap then
::SendMessage(hWnd, CUSTOM_MGS, wParam, lParam);
wParam and lParam are values that you can pass to the destination window, you can make use these params to send the bitmap information.
Handle the message in the destination window, refer ON_MESSAGE macro for message map entry. Use the bitmap information that you have sent in wParam or lParam and then draw the bitmap.
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Thank you for your help! I will try what you have said!!If I met any difficulty,hope you can help me . Thank you again!
|
|
|
|
|
If my program running by current user (for example, administrator or user), when turn off windows, that no problem. But if my program running by system user, when turn off windows, windows would open a error dialog.
How to solve this problem. Thanks.
|
|
|
|
|
Hi all
I have to read a comma seperated value text file. But i am not able to get it to work
Can any one help me out in this. Or if any one could show me some reference code.
The text is some what like this
bond,james,23,oxfordstr,canterbury,23421,abc@yahoo.com,82710120
Any or all help would be greatly appreciated.
ps note=> I couldnt not find any good article over this issue.
|
|
|
|
|
|
As folks responded to you previously, you can do this with strtok() (prototype in "string.h"), and as this is in my copy of Kernighan and Ritchie, I suspect it is supported in Borland.
If you want a packaged parser with source code, look at the link provided by ThatsAlok in replying to your previous post of the same question.
It's also amazing what you seem to find if you google on "c++ csv parser"...
-- modified at 21:10 Monday 19th March, 2007
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Software_Specialist wrote: But i am not able to get it to work
Can any one help me out in this. Or if any one could show me some reference code.
http://www.koders.com/default.aspx?s=csv&btn=Search&la=Cpp&li=*[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Software_Specialist wrote: But i am not able to get it to work
Why not? What have you tried?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
whoa.... four answers at the same time? we may have just exploded his brain with choices.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Jeffry J. Brickley wrote: four answers at the same time? we may have just exploded his brain with choices.
I had a fifth (ODBC), but my machine is not configured to test such a suggestion.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
how can i start the application associated to a specific file ending.
e.g.:
i have an excel-sheet and do not know the path of the excel.exe
but i want to start excel and open the file.
i tried
createprocess (null, "file.txt".....)
last error is 193 (not an application)
thats right
but how can i start the notepad in this case???
|
|
|
|
|
ShellExecute(...)
search it up, I Don't remember the parameters, but you can enter "file.txt" as the program to run, and put "open" on the action to perform. It will open file.txt in notepad or w/e you have .txt open in by association.
|
|
|
|
|
something like this[^], but instead of the html file, you provide your excel sheet
|
|
|
|
|
|
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = /*FILE NAME*/;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
ASSERT(ShExecInfo.hProcess); //after use
CloseHandle(ShExecInfo.hProcess );
priyank
|
|
|
|
|
hey im having a rich edit problem.. lets say the control has some text.. more than its height size.. and you resize the rich edit in the dialog's WM_SIZE event from the bottom of the dialog to down youll see that the text in the rich edit remains at the same location and down there will be some empty space but the scrollbar position is down and when you click the scrollbar the text will go down at the bottom of the rich edit control where it should be when i resize it as well
i tried so many methods of forcing the control to scroll down there but no one was really efficient and right
for example i have this method
[code]
void CDDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
m_richedit.MoveWindow(200, 200, cx - 200, cy - 200, FALSE);
m_richedit.PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
m_richedit.Invalidate();
}
[/code]
when i resize the dialog everything seems to work right but i can see the rich edit flicker the text up and then down which is pretty annoying..
i tried finding the message which tells the richedit that i resized it and make it not send the message.. but i couldnt really find it
then i thought using LineScroll but i never figured it out how it works.. it doesnt really work right for me
please think about both methods and tell me how i could do it right..
LineScroll seems ok.. but i kind of dislike the idea of a line scroll.. i use the rich edit as a chat window and it seems better if it has smooth scrolling instead of line scrolling
anyway i cant really understand microsoft.. they released many versions of this control and never noticed their bug ??? i mean look at word pad which uses a rich edit control and do what i said above and resize it down after you add a lot of text.. youll see what happens which is very stupid IMO
please help me.. im trying to fix this bug for many months ( im not joking ) and i cant continue my project.. im sure this will help many other people..
thanks
|
|
|
|
|
I never experienced this problem myself, but I did just dabble with it in Wordpad as you said, and I see what you're talking about. As you resize down it adjusts the scroll-bars range in respect to the size of the data, but it ignores the current scroll location being below the end of the data.
I don't know what you have already tried. I would try to get a handle to the scroll-bar and use "SetScrollPos" and see if that forces an update. To prevent it from changing, you may try "SetScrollPos(GetScrollPos())" or similar, I don't know the return types or parameters of these functions off the top of my head, but that would in essence tell it the user has scrolled, although the position won't really change, but it may force it to redraw the text in the right spot.
Another thing you can try is RedrawWindow() maybe.
Again, these are just little workarounds that may work, but I'm sure it's not the "right" way to do it. But maybe it'll get the job done. I've never tried them myself either, just what I would try if I was doing it.
Good Luck
|
|
|
|
|
hey, thanks for the reply
i have tried those before.. and no luck
m_richedit.SetScrollPos(SB_VERT, m_richedit.GetScrollPos(SB_VERT));
m_richedit.RedrawWindow();
they don't do anything
if you have any more ideas please post them here
thanks
btw you never experienced it because you never used the control ? or you never noticed it ? (just curious)
-- modified at 19:01 Monday 19th March, 2007
|
|
|
|
|
I've used the control, but not extensively enough to notice the problem. I've used it to write a paragraph worth of info basically, never had to use the scrolls. I was just saying that I don't have experience with the problem, but I was trying to offer things I would try as a solution if I did have that problem, but I see you're ahead of me, lol.
I notice in Wordpad, when the problem occurs if I hit the down arrow on the scroll bar, it'll fix it. Have you tried using SendMessage to send messages to emulate the user doing that? I don't know what those messages are tho.
The other thing you can do which may be "wrong" is
int oldScrollPos = GetScrollPos(SV_VERT);
SetScrollPos(SB_VERT, 0);
SetScrollPos(SB_VERT, oldScrollPos);
so it scrolls to the beginning then back to the end. I don't like it myself, it's sloppy, but if you want you can try it.
|
|
|
|
|
ah ok :P
yes i tried PostMessage(WM_VSCROLL, SB_BOTTOM, 0); and SendMessage(WM_VSCROLL, SB_BOTTOM, 0);
they do not work right if i dont add an Invalidate() after that but even after i do.. they cause the annoying flicker problem which i said at my first post
your last solution doesnt work.. funny i can see the scrollbar flickering up and down but no change to the text area. lol.
thanks again
|
|
|
|
|
I recreated the problem in Wordpad, as you mentioned before, and created a program to send window messages to it to fix it. And this is what worked for me. You can send these messages from within your own program where necessary. I only made a seperate app, because I couldn't just rewrite wordpad :-P
::SendMessage(HandleOfRichEditControl, WM_VSCROLL, SB_LINEDOWN, 0);
::SendMessage(HandleOfRichEditControl, WM_VSCROLL, SB_ENDSCROLL, 0);
The one with ENDSCROLL may not be needed, but it is sent after LINEDOWN when I press the down arrow on the scroll bar. So it may be needed for more accurate emulation of the user pressing it. Who knows.
|
|
|
|
|
ah sorry for the late reply.. yeah it works.. same goes for SB_BOTTOM but the problem is it creates some flicker.. you could see the lines going up and then down very fast.. i just need to find a way to scroll it down and not have that flicker.. thats all and i have no idea..
thanks
|
|
|
|
|
It should only flicker as you're resizing, which shouldn't be that big of a deal? If it's flickering all time you probably have the scrolling code in the wrong place.
A lot of controls flicker during resize AFAIK. You should be able to search up ways around that. I think it involves drawing the dialog off-screen and then repainting it on-screen, like a double buffer. I'm sure there are other ways too. I just know that you'll be able to find something.
|
|
|
|