|
I did once a trick by setting a groupbox around the controls.
This groupbox' rectangle is exactly the rectangle to hide. You can then redraw your video window.
how to hide your menu I don't know.
here's some sample code I've used.
CRect filterrect;
CRect flexlistrect;
CRect hsbtnrect;
CWnd* pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC3);<br />
pWnd->GetClientRect(filterrect);<br />
m_lstActivations.GetClientRect(flexlistrect);<br />
m_btnhideshow.GetClientRect(hsbtnrect);<br />
<br />
topoflisthidden = hsbtnrect.bottom + 15;<br />
topoflistshown = filterrect.bottom + hsbtnrect.bottom + 15;<br />
bottomoflisthidden = flexlistrect.bottom + filterrect.bottom + hsbtnrect.bottom - 5;<br />
bottomoflistshown = bottomoflisthidden - (filterrect.bottom);<br />
widthoflist = filterrect.right;
<br />
if(showed == false){<br />
sortcol = 2;
CWnd *pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_COLUMN);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_EDIT_COLUMNVALUE);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC2);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_SORT);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_VALUE);<br />
pWnd->ShowWindow(SW_HIDE);<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_SORTCOLUMNS);<br />
pWnd->ShowWindow(SW_HIDE);<br />
<br />
m_lstActivations.Clear();<br />
m_editcolumnvalue.SetWindowText("");<br />
m_combocolumn.SetCurSel(0);<br />
<br />
sessionsettings->filtercol_inpat = 0;<br />
sessionsettings->filtervalue_inpat = "";<br />
sessionsettings->selectedrow_inpat = 1;<br />
sessionsettings->sortcol_inpat = 0; <br />
sessionsettings->showed_inpat = showed;<br />
<br />
HICON icon;<br />
icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_SHOW), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
m_btnhideshow.SetIcon(icon);<br />
<br />
m_lstActivations.MoveWindow(0 + 15 - 3, topoflisthidden, widthoflist-1, bottomoflisthidden);<br />
showed = true;<br />
}
else{<br />
if(m_combosort.GetCurSel() != -1){<br />
sortcol = m_combosort.GetCurSel() + 2;
}
m_lstActivations.MoveWindow(0 + 15 - 3, topoflistshown, widthoflist-1, bottomoflistshown);<br />
CWnd *pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_COLUMN);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_EDIT_COLUMNVALUE);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC2);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_SORT);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_STATIC_VALUE);<br />
pWnd->ShowWindow(SW_SHOW);<br />
pWnd = (CWnd*)GetDlgItem(IDC_COMBO_SORTCOLUMNS);<br />
pWnd->ShowWindow(SW_SHOW);<br />
<br />
HICON icon;<br />
icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_HIDE), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
m_btnhideshow.SetIcon(icon);<br />
<br />
sessionsettings->showed_inpat = showed;<br />
m_editcolumnvalue.SetFocus();<br />
showed = false;<br />
}
m_btnhideshow.SetButtonStyle(BS_PUSHLIKE|WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_ICON|BS_TOP|BS_LEFT);<br />
m_PrintList.SetButtonStyle(BS_PUSHLIKE|WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_ICON|BS_TOP|BS_LEFT);<br />
HICON printicon;<br />
printicon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_PRINT), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
m_PrintList.SetIcon(printicon);<br />
<br />
CRect rect, rect1, rect2, rect3;<br />
CWnd* pWnd;<br />
pWnd = (CWnd*)GetDlgItem(IDC_LIST_ACTIVATIONS);<br />
pWnd->GetClientRect(rect1);<br />
rect3.bottom = 16 + 5;<br />
rect3.top = 5;<br />
rect3.right = rect1.right;<br />
rect3.left = rect1.right - 16;<br />
m_PrintList.MoveWindow(rect3, TRUE);<br />
m_PrintList.GetClientRect(rect2);<br />
rect.bottom = 16 + 5; <br />
rect.top = 5;<br />
rect.right = rect1.right - rect2.right - 5;<br />
rect.left = rect1.right - rect2.right - 5 - 16;<br />
m_btnhideshow.MoveWindow(rect, TRUE);<br />
UpdateWindow();<br />
if(initializing == false){<br />
OnRefresh();<br />
}
<br />
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I want to implement Client/Server Application between Windows and Solaris Machine.Client can communicate to different Solaris Machines.How to handle Multiple socket connections and all socket connections I want run as threads.
Can give any idea or any examples please.
|
|
|
|
|
hi ,
Ur question does not describe the context in which ur running ur application.
I am assuming that ur running a custom TCP/IP server seevice on a solaris
machine. (Otherwise , how ur Client will communicate to Solaris machine ?)
And client machine seems to be windows.
If u take any book on socket programming , that will show u how u can
write a rudimentary server ( some books even deal with HTTP servers )
Basic idea is as follows
ur server will wait for the connection. There are steps
like calling socket function , binding the socket with protocol port address
etc.
When a client initiates a call to the server. Server will create
a new thread or task ( using posix threads package or unix fork function )
and the new request will be handled by the threads. So learn Berkely socket API , Posix threads , Unix fork etc. And try to refer following books
Unix network programming by Richard stevens is the place to go for
Linux / Unix programmers
Winsock programming by Lewis napper will give u idea about Windows socket programming
U can also read Interetworking with TCP/IP by Douglas comer. A chapter on socket programming is there.
Praseed Pai
www.praseedpai.com
|
|
|
|
|
Thank u for reply.I gave lot of inputs to me.I implemented Single threaded Apps.Now that I want convert into multithreading.I was getting Segmentation Fault (core dumped) error.pl tell me How to avoid this?
Thanks in advance
dadsadasd
|
|
|
|
|
Sorry Correction in last reply.Instead of I replace with U.
dadsadasd
|
|
|
|
|
Hello 2all!
I've a simple problem (hopefully):
My visual c++ application have to map a smb share (like typing "net use z: \\server1\c$ ...") at the DOS-prompt. How do I figure this out?
I've tried out the shellexec command but this isn't working properly.
Is there another method to access files lying on a smb share directory on a server?
- Jan
|
|
|
|
|
Look at the WNetAddConnection() , WNetAddConnection2() and WNetAddConnection3() functions on MSDN.
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 Williams (Little Britain)
|
|
|
|
|
HI,
I want send and recive Data on Printer Port
how ???
any sample code help
thanx
|
|
|
|
|
i have built an application which was running fine till now as administrator. now, i tried running it as a user, it failed. Does a user do not have access to C:\WINNT\system32\drivers files. actually i am loading a driver(.sys) in my application. so when it runs as a user(other than administrator), it fails to load the driver. but it is very important that all the user logged on to the machine can run the application. also i do not want to move the driver from the C:\WINNT\system32\drivers directory. Is there any way out?
|
|
|
|
|
Hi guys
I'm trying to change my mouse icon when it's passing over a zone in a Picture Control but unsuccesfully.Could you explain me what steps I have to do to implement this?
I'm trying with OnMouseMove to control the zone,and it detects perfectly my zone, but once there, how can I change my mouse icon (remember that is not a button it's a Picture control).I've tried a LoadIcon unsuccesfully.
Thanks in advance.
Doc
|
|
|
|
|
use m_nActiveCursor as a member to store the ID of the cursor which has to be shown
int the OnMouseMove change the cursor as you do using:
SetCursor(LoadCursor( AfxGetInstanceHandle(), MAKEINTRESOURCE(m_nActiveCursor)) );
Also set the cursor in the OnSetCursor correct.
SetCursor(LoadCursor( AfxGetInstanceHandle(), MAKEINTRESOURCE(m_nActiveCursor)) );
Hope this helps.
|
|
|
|
|
Hi GDavy
Still nothing happens
When the mouse is over the zone, still the arrow is shown
void CLinksCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
if ((point.x>7)&&(point.x<188)&&(point.y>0)&&(point.y<23)) {
m_nActiveCursor=1; //HAND
} else {
m_nActiveCursor=32512; // DEFAULT ARROW
}
SetCursor(LoadCursor( AfxGetInstanceHandle(), MAKEINTRESOURCE(m_nActiveCursor)));
CStatic::OnMouseMove(nFlags, point);
}
BOOL CLinksCtrl::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
SetCursor(LoadCursor( AfxGetInstanceHandle(), MAKEINTRESOURCE(m_nActiveCursor)));
return CStatic::OnSetCursor(pWnd, nHitTest, message);
}
Something wrong?
Thanks
Doc
|
|
|
|
|
return TRUE in the OnSetCursor function... ( NOT return CStatic::OnSet...)
Regards
|
|
|
|
|
Sorry
Same result
I'll keep trying
Maybe some Control Property or not?
Thanks
Doc
|
|
|
|
|
hmm... Sorry did not notice this earlier
your values are predefined arrow and hand pointers, in that case you do not need
the MAKEINTRESOURCE macro. you need this macro if the id would be the id from a cursor you manually added in the resources.
|
|
|
|
|
Hi,
I have a header file which is included in 1 project which has to be included in another too. I can copy it to the other project and then include it, but when the header changes i have to copy the file again to the other location.
How can i easily maintain only 1 version of that file?
I have seen i can import a header file from another location, but when i do #include "Myheader.h" or #include <myheader.h> the header isn't found neither.
Can you help?
|
|
|
|
|
You need to ensure that the location of MyHeader.h is in the include path for both of your projects.
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 Williams (Little Britain)
|
|
|
|
|
First of all, thanks for the reply.
I had included the location of 'Myheader.h' file in the first project like 'C:\vss\'. I knew it was going to be in a subdirectory of 'C:\vss'. I've now replaced it with the exact directory and now the compiler finds the file!! Really strange. (No recursive search?)
I've alsoo written a class in project 2 that needs to be accessed from project 1 alsoo. I have set my include paths correctly. It links in project2 correctly but in project1 it receives errors while linking. If i put the files in directory of project 2, the class compiles without a problem. How is this possible?
|
|
|
|
|
Are you talking about a header file and a lib ?
If so you need to ensure the compiler knows where the .lib file is also. It isn't sufficient to just state where the header is.
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 Williams (Little Britain)
|
|
|
|
|
Antony,
I meant a class having a .h (header) and a .cpp .
|
|
|
|
|
What is the link error message you are receiving?
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 Williams (Little Britain)
|
|
|
|
|
HI,
I have a Device to whom i can Allot an IP.
I only know its IP now ..
I want to Connect to to it.
How can i do ...
i not know abut its port and cannot set any port
asny way to solve plz
thanx
|
|
|
|
|
Hi,
Can someone tell me how to get the path to a user's home directory "c:\Documents and settings\username". I tried reading the desktop path from HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders, and remove "\\Desktop" from it, but then on Non-english OS, the Desktop is called something else.
So is there any standard API that can give me this path?
Thanks
~f
|
|
|
|
|
Take a look at GetUserProfileDirectory() in the MSDN
|
|
|
|
|
Hey thanks for the pointer. The documentation says it is not supported under win98, so I just read the environment variable USREPROFILE.
|
|
|
|