|
I found a solution. For the curious, I will post it here:
The main problem is that the window needs to change its HRGN shape and its position at the same time. Since the new shape will not be correct until the window is in the new position, I needed the window to redrawn only when both the new HRGN and the new position have been set but I still needed to restore the background in areas of the old shape which were not part of the new shape.
<br />
void CAnimateWnd::UpdateRgnAndPos(HRGN hNewRgn, int iPosX, int iPosY)<br />
{<br />
HRGN hOldRgn = CreateRectRgn(0, 0, 0, 0);
GetWindowRgn(hOldRgn);<br />
<br />
HRGN hOffRgn = CreateRectRgn(0, 0, 0, 0);
CombineRgn(hOffRgn, hNewRgn, NULL, RGN_COPY);
OffsetRgn(hOffRgn, iPosX - m_iOldPosX, iPosY - m_iOldPosY);
<br />
HRGN hCombinedRgn = CreateRectRgn(0, 0, 0, 0);
CombineRgn(hCombineRgn, hOffRgn, hOldRgn, RGN_OR);
<br />
SetWindowRgn(hCombinedRgn, FALSE);
<br />
SetWindowPos(iPosX, iPosY, 100, 100, SWP_NOACTIVATE);
<br />
SetWindowRgn(hNewRgn, TRUE);
<br />
Invalidate(TRUE);
<br />
m_iOldPosX = iPosX;
m_iOldPosY = iPosY;<br />
}<br />
|
|
|
|
|
Maybe you could uses 2 windows. You set the shape on the new window, show it (above the old), hide the old.
Or uses layered windows (see SetLayeredWindowAttributes) if you are using Windows 2000 or Windows XP. This allows to create transparent and semi-transparent windows.
Philippe Mori
|
|
|
|
|
Hello,
I have problem with a CListCtrl. As you know, pushing up/bottom arrow allow you to move up and down through the elements of your list (it's builtin). Everything was perfect since yesterday
I noticed that the arrows didn't respond. A message (WM_KEYDOWN) seems to be blocked by something but i can't put the finger on it. Mouse events work perfectly.
I derived a class from CListCtrl and i put it in a form derived from CFormView. As i said,all was working perfectly two days ago. The problem seems to be simple, i do not use special or custom code to process messages. I think i respect the way to implement controls using MFC.
Any tips to locate simply (with VC debugger) where the problem is?
Thank u!
Fred
C++/MFC/SQL Developer.
|
|
|
|
|
I'm not sure what differences you have between now and two days ago, but it sounds like you're being bitten by IsDialogMessage. Certain keystrokes are trapped by the system and treated as dialog navigation keys, rather than being sent to the control. Besides direction keys, this also includes things like Tab. Try adding a handler for WM_GETDLGCODE to your control. Return DLGC_WANTARROWS.
Scot Brennecke
Software Developer
VC++ MVP
|
|
|
|
|
Thank you,
I try immediately.
Fred
|
|
|
|
|
Scot,
First,thank you to pay attention at my problem!.
I noticed, after you answered me, that any controls trough the application get messages (concerning keystrokes).
I implemented what you adviced me everywhere in my controls but never i entered in the fucntion OnGetDlgCode ...
afx_msg UINT OnGetDlgCode( );
ON_WM_CREATE()
UINT
Cxxx::OnGetDlgCode()
{
return Cxxx::OnGetDlgCode() | DLGC_WANTARROWS | DLGC_WANTTAB;
}
It's a very weird situation.
Anyway thanks for your help.
Frédéric.
Fred
C++/MFC/SQL developer
|
|
|
|
|
Hi,
I am writing a html help file for an application(which is similar to Adobe photoshop help files).I would like to know is there any microsoft standard guidelines for writing such help files?
Thanks
Asha
|
|
|
|
|
|
I have a Composite Control with a list control drawn in my resource. I created my own CListCtrl derived class, which adds sorting of columns.
Now I want to do some custom drawing, but I cannot get this to work. Some how I do not receive the NM_CUSTOMDRAW message. I used ON_NOTIFY_REFLECT and also tried the OnNotify method to receive this message, but here I only got the message from the header, not from the list itself.
How can I receive this message ? Must I do something else with the message map?
By the way, I used m_mylist.SubclassWindow(GetDlgItem(IDC_LIST)) to link the list control object to the list control.
|
|
|
|
|
hi all,
pls try answer my question!
i want to know how can i send data to java server in client/server program?
since the server is not written in java which do not use CArchive to receive data, i found there is some strange data sent to the java side server if i use the CArchive in the mfc client application.
do you know how can i send a pure data to other server or receive data from server if i don't use CArchive. Or, how can send data to non-MFC application in client/server program in a MFC application using CSocket, CSocketFile and CArchive?
thanks,
jim
|
|
|
|
|
Screw the MFC socket class and use the Win32 api directly. Its easy. CArchive & co are meant for when there are other MFC apps on the other end.
Beware of byte ordering issues.
BTW, wouldn't it be better to use java on the client and C in the server. I was thinking of the performance implications, unless the server will only have, at most, a handful of clients.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
I've created an ISAPI module and i want to write an installation kit.
Is it possible to create virtual directories on IIS working just in command line style?
rechi
|
|
|
|
|
I'm hosting Web Browser in my app. When document contains frames with pages from different domains, it causes acces denied (COM Error) when trying to access document in frame. How to avoid it??
I read MSDN article "Permission Denied Error Message When Scripting Across Frames", but there was written about scripts only...
|
|
|
|
|
Help me to clear doubts on VC++ DhtmlEdit Controll for IE5[Table insert,Paste html...]
I am trying to develop a html editor using vc++6.
Now I am facing five major problems
1 How add Toolbar in a Dialog Based Application using vc+6 ? ,Is it possible in Dialog Based Application ?.
2 How insert a Table in a html page using vc+6's DHTML EDIT Control for IE5 ?.
3 How implement PasteHtml using vc+6's DHTML EDIT Control for IE5 ?.
4 How insert an adjecent Html?
5 How devolop a file opening dialog with html preview ?
The following shows my code for each problem ...
** Problem 2: VB code OK:-
Dim s As New DHTMLEDLibCtl.DEInsertTableParam
s.Caption = "test"
s.NumCols = "2"
s.NumRows = "2"
s.TableAttrs = "border=20"
s.CellAttrs = "bgcolor=black"
DHTMLEdit1.ExecCommand DECMD_INSERTTABLE, OLECMDEXECOPT_PROMPTUSER, s
** How it solve in VC++6 ?
----------------------------------------------
** Problem 3: VB code OK:-
Private Sub btnInsertNewTag_Click()
'insert new tag at cursor position
Dim tr As Object
Set tr = DHTMLEdit1.DOM.selection.createRange
tr.pasteHTML " "
End Sub
** How it solve in VC++6 ?
----------------------------------------------
** Problem 4: VB6 code Error:-
DHTMLEdit1.DOM.body.insertAdjacentHTML "body", "hr"
** Problem 4: VC++6 code Error:-
// It is not proper working.
LPCTSTR lpStrWhere= "body";
LPCTSTR lpStrHtml= "hr";
m_ctrlDhtml.GetDom().GetBody().insertHTML(lpStrWhere,lpStrHtml);//error
----------------------------------------------
If you know any methods to solve any of these problem ,you please send the source code or web site address.
Anticipating your early reply
Regards
ranjithe2002@hotmail.com
Thanks..
mail me
ranjithe2002@hotmail.com
|
|
|
|
|
hi
i have to make a font editor application which creates customised fonts
i have designed a ui which gives user a place to draw the font charactor's shape
now i dont know how am i going to convert it into font & store it into the file
if anyone there can guide me or give me some appropriate links
thanks
surbinsho
|
|
|
|
|
oh god, really not easy work to create usable font (editor)
do they really know what they request?
(do you know something more about fonts than they have shapes? maybe try look at links from http://www.codeproject.com/winhelp/format_tips.asp)
what font type do they want?
maybe older infos (?): http://www.wotsit.org/search.asp?s=font
maybe http://www.sourceforge.net/search ("font editor")
msdn help/specifications/opentype links to adobe.com, truetype seems inside
(sorry, no real experience with font file type specifications)
t!
|
|
|
|
|
This may be of help
http://www.wotsit.org/search.asp?s=font
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
http://tds-crew.thebugs.ws
|
|
|
|
|
I don't even know what most of those things stand for. Is this URL to a shop, or a pirate site ?
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Christian Graus wrote:
Is this URL to a shop, or a pirate site ?
Definitely the latter. Such pages really shouldn't be allowed.
Peter O.
|
|
|
|
|
|
|
Nishant S wrote:
Did you really think you can mess up the forums by putting that in a message?
some people are just plain stupid
Soliant
"Every man dies, not every man really lives"
- Braveheart
|
|
|
|
|
When you press ctrl and the lbutton at the same time over almost anything, a little plus sign is added to the cursor. I can't seem to find anything that talks about that. How do you do it?
-Raffi
|
|
|
|
|
See the articles in the Drag and Drop section.
For normal OLE d&d, you'll just return DROPEFFECT_COPY at the appropriate time and place.
Or if you're doing your own thing, you can just create a cursor with a little plus sign in it...
--------
PMGRE --Shog9 --
|
|
|
|