|
This Program is to detect the window. I associate this program with my calibration process in a machine.Calibration Process is working but it isn't able to detect this window. That's what I am looking for.
I know I need to add few lines in this code. But don't know what to add.
I really don't have any idea how to do this.
Help
Thanks
Preeti9
|
|
|
|
|
Preeti9 wrote:
I know I need to add few lines in this code. But don't know what to add.
DO u Know the Name of the Window to DETECT?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Preeti9 wrote:
This Program is to detect the window.
What window? The window that belongs to your program, or a window that belongs to some other process? What does the "calibration process in a machine" have to do with any of this? Is that related to this mysterious window somehow?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I am using a child frame window to display a view. The child frame window can be resized and when the frame is made smaller than the view scroll bars are appearing and ruining the effect that I want to achieve. The view was created in the resource editor and is of type CFormView. The frame is of type CMDIChildWnd. I have tried a bunch of the following combinations and this is where I am at...
ModifyStyle(WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU | WS_THICKFRAME | WS_CAPTION | WS_BORDER | WS_HSCROLL, 0, SWP_NOMOVE);
ModifyStyleEx(WS_EX_STATICEDGE | WS_EX_RIGHTSCROLLBAR, 0, SWP_NOMOVE);
Doesn't work
Any insight???
|
|
|
|
|
raybert wrote:
when the frame is made smaller than the view scroll bars are appearing and ruining the effect that I want to achieve.
What is that effect? You might handle WM_SIZE messages in your view and call SetScrollSizes from the corresponding OnSize function. But what to do exactly might depend on what you are trying to achieve.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thank you for your response. I am actually asking this question for a co-worker so I needed to find out what effect he wanted. Basically, it is whenever the child window is resized to a smaller size he does not want the vertical or horizontal scrollbars to appear. I hope that makes some sense.
|
|
|
|
|
raybert wrote:
I am actually asking this question for a co-worker
raybert wrote:
it is whenever the child window is resized to a smaller size he does not want the vertical or horizontal scrollbars to appear
raybert wrote:
I hope that makes some sense.
Not much more than the original question, but never mind. If your co-worker is interested, tell him/her to post him/herself to the forum, an explain a bit more.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
D3DXCreateTextureFromFile(g_pD3DDevice,"Texture.bmp",&g_pTexture);
如果要把讀.bmp改成讀CBitmap的話,要如何改?
How to I change that input .bmp replace as input CBitmap For CreateTexture?
Becuse I want to use my file format.
|
|
|
|
|
I have an mfc ActiveX control. It exports a few functions and uses an COleControl for its main window. Basically on this machine I have running win2K it crashes when closing down.
The crash occurs in AfxWinProc due to the module state returning a null CWnd pointer given the hwnd - the message is WM_DESTROY. Somehow MFC has gone and dumped all its hWnd to CWnd* maps and the call to AfxWinProc causes the whole thing to just crash.
Unbelievably MFC doesnt simply test for a null CWnd pointer, it insists on just ASSERTing it like mad and trying to carry on regardless.
|
|
|
|
|
I have a dialog based application very simple (visual c++ .net). i added a windows media player control to the dialog resource. next i gave an id IDC_PLAYER. next i added a variable called m_ctrlPlayer(Add Variable). I have also a button (play) and below is the event handler for that button.
void CWindowMediaDlg::OnBnClickedPlay()
{
// TODO: Add your control notification handler code here
m_ctrlPlayer.GetControls().play();
}
i get this error when i try to compile the project....
error C2039: 'GetControls' : is not a member of 'COcx1'
ocx1.h(11) : see declaration of 'COcx1'
error C2228: left of '.play' must have class/struct/union type
and here is how COcx1 looks...
#pragma once
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
/////////////////////////////////////////////////////////////////////////////
// COcx1 wrapper class
class COcx1 : public CWnd
{
protected:
DECLARE_DYNCREATE(COcx1)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x6BF52A52, 0x394A, 0x11D3, { 0xB1, 0x53, 0x0, 0xC0, 0x4F, 0x79, 0xFA, 0xA6 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID);
}
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey);
}
// Attributes
public:
enum
{
amvUninitialized = 0,
amvLoading = 1,
amvInteractive = 3,
amvComplete = 4
}ReadyStateConstants;
enum
{
mpStopped = 0,
mpPaused = 1,
mpPlaying = 2,
mpWaiting = 3,
mpScanForward = 4,
mpScanReverse = 5,
mpClosed = 6
}MPPlayStateConstants;
enum
{
mpDefaultSize = 0,
mpHalfSize = 1,
mpDoubleSize = 2,
mpFullScreen = 3,
mpFitToSize = 4,
mpOneSixteenthScreen = 5,
mpOneFourthScreen = 6,
mpOneHalfScreen = 7
}MPDisplaySizeConstants;
enum
{
mpReadyStateUninitialized = 0,
mpReadyStateLoading = 1,
mpReadyStateInteractive = 3,
mpReadyStateComplete = 4
}MPReadyStateConstants;
enum
{
mpTime = 0,
mpFrames = 1
}MPDisplayModeConstants;
enum
{
mpShowURL = 0,
mpClipURL = 1,
mpBannerURL = 2
}MPMoreInfoType;
enum
{
mpShowFilename = 0,
mpShowTitle = 1,
mpShowAuthor = 2,
mpShowCopyright = 3,
mpShowRating = 4,
mpShowDescription = 5,
mpShowLogoIcon = 6,
mpClipFilename = 7,
mpClipTitle = 8,
mpClipAuthor = 9,
mpClipCopyright = 10,
mpClipRating = 11,
mpClipDescription = 12,
mpClipLogoIcon = 13,
mpBannerImage = 14,
mpBannerMoreInfo = 15,
mpWatermark = 16
}MPMediaInfoType;
enum
{
dvdMenu_Title = 2,
dvdMenu_Root = 3,
dvdMenu_Subpicture = 4,
dvdMenu_Audio = 5,
dvdMenu_Angle = 6,
dvdMenu_Chapter = 7
}DVDMenuIDConstants;
enum
{
mpShowDialogHelp = 0,
mpShowDialogStatistics = 1,
mpShowDialogOptions = 2,
mpShowDialogContextMenu = 3
}MPShowDialogConstants;
// Operations
public:
};
someone pleaze tell me how i fix this problem. thax
thanx hussein
|
|
|
|
|
Add int the CWindowMediaDlg:
#include "wmpcontrols.h"
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
c+- wrote:
i still get errors.....
WindowMediaDlg.cpp(5) : fatal error C1083: Cannot open include file:
'wmpcontrols.h': No such file or directory ...where can i get this file...
Quite strange. How have you added Windwos Media to your project? I suppose by "Project > Add to project > Components and Controls > Registered ActiveX Controls > Windows Media Player", isn't it?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
NO i didn't add it like that. There is no such menu item 'Add to project' under project menu. this is how i added, in resourse view right click on toolbax->Add/remove items->COM components->windows media player then the control appeared on the toolbax, then i added it to dialog.
hussein
|
|
|
|
|
I've tried on VC++6 and it works like a charm. I can't test it in a VC.Net environment so there have to be something missing.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Is there a version of StringFromCLSID for ANSI?
Don't try it, just do it!
|
|
|
|
|
Try UuidToString. I'm not sure if it encodes the values the exact same way.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
CString CGuid::ToString(bool withCurlies) const
{
#ifdef _UNICODE // ----- UNICODE -----------
LPCWSTR mask = withCurlies ? L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}" :
L"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X";
#else
LPCSTR mask = withCurlies ? "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}" :
"%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X";
#endif
CString s;
s.Format(mask,
Data1, Data2, Data3, Data4[0], Data4[1],
Data4[2], Data4[3], Data4[4], Data4[5],Data4[6], Data4[7]);
return s;
}
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Hi, all:
I am trying to create some cursors with bigger than 32x32x256 color. Here is what I did:
I created a simple Dialog Based MFC appication and place a simple button (IDC_BUTTON1) on the dialog.
I created a 96X96x256 color cursor in the Resource Editor: IDC_CURSOR1 ( Deleted the 32x32XMono) .
In the Button1 click event handler, I have the following code:
<br />
void CCursorTestDlg::OnButton1() <br />
{<br />
::SetCursor(::LoadCursor( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDC_CURSOR1) ));<br />
<br />
}<br />
I also handle the WM_SETCURSOR event as
<br />
BOOL CCursorTestDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) <br />
{<br />
<br />
return TRUE;<br />
<br />
}<br />
After I clicked on the Button1, the cursor changed to the IDC_CURSOR1, but shrinked it to 32x32 size.
What do I do wrong, how can I keep it to my size in the Resource Editor?
Thanks in advance and your help is highly appreciated.
Dion
|
|
|
|
|
Have you tried using LoadImage() instead of LoadCursor()? IIRC LoadCursor only loads cursors of the default size for the system.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks very much. It works.
|
|
|
|
|
Thanks much.
The LoadImage() does give me the bigger size cursor. However, I still have a couple of problems:
1. I have a finger cursor with 256 colors. If I use Loadmage(), besides the finger, I see a shadow on the 96x96 square and it is not entirely transparent. If I use 16 color, the square disappears as normal window cursor but I lost all the pretty colors. Is there anywy to fix this?
2. In my application, I have to click on 3D objects. Before I made the changes ( I used LoadCursor() ), the cursor works fine. Now, If I click on a 3D object ( MouseDown) the cursor disappears until I move the mouse a little. It does not happen in the LoadCursor() scenario, but in LoadImage() calls. I am puzzled.
Thanks for your help.
Dion
|
|
|
|
|
hello,
I created a dialog based application.I pop up a modal dialog from the menu created in my application.Class midialog is associated with this dialog resource.By mistake i created an obj of this class in the menu handler as shown in code below.
OnMenu()//handler in my application dialog class.i.e.main dialog
{
midialog m_d;
m_d.DoModal();//creating my modal dialog
}
after couple of daysi realized that i wanted the obj not inside the handler but in the class CMainDlg(class of the main dialog).So i removed above code
and tried to declare a variable of type midialog m_d(again,suppose).then i wrote menu handler as
OnMenu()
{
m_d.DoModal();
}
midialog m_d; declared as public variable.But on compilation this code gives error.why?
syntax error : missing ';' before identifier 'm_d'
midialog' : missing storage-class or type specifiers
m_d' : missing storage-class or type specifiers
These errors are given at the declaration statement of variable
please help
thanks
|
|
|
|
|
sayup wrote:
midialog' : missing storage-class or type specifiers
You probably need to include the header where the dialog class is declared.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
hello,
in the parent dialog class i have included the header for my dialog class.is it necesary to declare it at some specific locatuion;like at start of parent class .cpp or whether at start of .h
please help
what might the problem be?
thanks
|
|
|
|
|
You have to include it in the .h file as the variable is declared in the class itself (so in the .h file).
|
|
|
|
|