|
but it is already opened by another program in CFile::shareExclusive mode,that is currently running in the system.so is there any way to open
that perticular file in my program at the same time?
nirmal
|
|
|
|
|
yes it is possible...but only from kernel-mode with a device-driver. You must use the IoCreateFile call to open a handle to the file - this bypasses the security/access checks so you must never use this technique on a 'real' system!
james
http://www.catch22.net
|
|
|
|
|
I wanna how to develop window app with c. petzold book programming windows also use vc resource editor .
corresponding question:Is the resource compiler a must for window programming? that is ,to develop window app, must I have c compiler, linker, resource compiler?
|
|
|
|
|
i don't think you need the resource compier as a "must" for windoww programming.
you can always create your windows at runtime, but that's very expensive efforts
|
|
|
|
|
i have to use CXimage class in my project.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
i think that this question relates more to the CxImage article, so you should ask this in the article's message board[^] at the bottom of the article...
|
|
|
|
|
1.i want hook some windows get them message and management.
... ...()
{
...
// one window hWnd created
CMyWnd *pWnd = new CMyWnd;
if (pWnd) pWnd->SubclassWindow(hWnd);
...
}
one window created then new a CMyWnd to subclass the window, but more windows that need more memory. how to fix?
do you have some good idea?
2. SubclassWindow one window,final must need UnSubclassWindow?
|
|
|
|
|
U don't have to subclass a window to get all the messages to that window.
There r two ways
1) Replace the window proc of that window with one of yours( don't forget to call the original one in your window proc )
or
2) Install a hook using SetWindowsHookEx()
nave
|
|
|
|
|
thanks.
1. Replace the window proc and SubclassWindow is different?
2. if i use SetWindowsHookEx get all message maybe the will slow.
i want high efficiency management SOME WINDOWS, and same classname window do same something. (if can only use C that is good).
|
|
|
|
|
Even though while subclassing the proc is repaced, u have to new a CWnd class for subclassing. isn't? But if we are repacing the proc we don't have to new any pointers
nave
|
|
|
|
|
i know, that is my base idea. but i need in some windows create some childwindows, only in one function to do that is so difficulty, management childwindows and windows not expedient, but in one CWnd, you only do about one window thing.
|
|
|
|
|
This whole world of dealing with certificates and stuff, kinda sucks.
None of it really makes any sense.
Anyhow, I need to put together a build process.
And, I need to sign all of the exe's and dll's I make.
But using signcode, it asks me to type in the password for my private key.
Is there any way to automate this?
Do you have any references to good sites that explain this?
Are there alternative tools for signing that could help me?
Thanks!
P.S. I know this doesn't really belong in this forum, but this is where the smart folks are....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
|
yuk.
Do you know of any alternatives to signcode?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
I found this handy program on the net....
int _tmain(int argc, _TCHAR* argv[])
{
if ( argc != 2 )
{
printf( "SignHelper CommandLine: SIGNHELPER {private-key-password}\n");
return -1;
}
char *pwd = argv[1];
// Password for auto-filling Signcode.exe's password dlg
#define SIGNCODE_DLG_TITLE "Enter Private Key Password"
BOOL fPwdSet = FALSE;
while(TRUE)
{
// Try to find Signcode's dialog
HWND hDlg = ::FindWindow("#32770", SIGNCODE_DLG_TITLE);
if(hDlg)
{
// Find the pwd edit box and the OK button
HWND hEdit = ::GetDlgItem(hDlg, 0x1F5);
HWND hOK = ::GetDlgItem(hDlg, IDOK);
if(hEdit && hOK)
{
// In Win32 you can't do a WM_SETTEXT to a wnd in another process.
// Instead, "type" the passwd, char by char, to the pwd edit box
LPCSTR psPwChar = pwd;
while(*psPwChar)
{
::PostMessage(hEdit, WM_CHAR, *psPwChar, 0);
psPwChar++;
}
// Now "click" the pwd dlg's OK button
::PostMessage(hOK, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(3,3));
::PostMessage(hOK, WM_LBUTTONUP, 0, MAKELPARAM(3,3));
fPwdSet = TRUE;
}
}
// Don't hog the CPU while we're waitingto find the dlg
Sleep(100);
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
-- modified at 3:52 Friday 3rd March, 2006
|
|
|
|
|
Did you try signtool? E.G., signtool sign "$(TargetPath)"
(in your post build step)
HTH,
- Ed.
--------------------------------
|
|
|
|
|
Hi all,
I have created an application that described in this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmform95/htm/writingvideoimagesamples.asp[^]
and my code is like below :
int _tmain(int argc, _TCHAR* argv[])
{
IWMWriter *writer = NULL;
IWMProfileManager *manager = NULL;
IWMProfile *profile = NULL;
IWMStreamConfig *stream = NULL;
IWMCodecInfo2 *codecInfo = NULL;
IWMMediaProps *mediaProps = NULL;
WM_MEDIA_TYPE *mediaType = NULL;
HRESULT hr = S_OK;
CoInitialize(NULL);
hr = WMCreateProfileManager(&manager);
hr = manager->QueryInterface(IID_IWMCodecInfo2, (void**)&codecInfo);
hr = manager->LoadProfileByID(WMProfile_V80_256Video, &profile);
//searching for codec that support WMMEDIASUBTYPE_WVP2
DWORD infoCount = 0;
hr = codecInfo->GetCodecInfoCount(WMMEDIATYPE_Video, &infoCount);
for(DWORD i = 0; i < infoCount; i++)
{
hr = codecInfo->GetCodecFormat(WMMEDIATYPE_Video, i, 0, &stream);
hr = stream->QueryInterface<iwmmediaprops>(&mediaProps);
DWORD mediaSize = 0;
hr = mediaProps->GetMediaType(NULL, &mediaSize);
mediaType = (WM_MEDIA_TYPE*) new BYTE[mediaSize];
hr = mediaProps->GetMediaType(mediaType, &mediaSize);
if(mediaType->subtype == WMMEDIASUBTYPE_WVP2)
{
break;
}
else
{
mediaProps->Release();
mediaProps = NULL;
stream->Release();
stream = NULL;
delete [] mediaType;
mediaType = NULL;
}
}
hr = manager->CreateEmptyProfile(WMT_VER_9_0, &profile);
stream->SetStreamNumber(1);
hr = profile->AddStream(stream);
CoInitialize(NULL);
hr = WMCreateWriter(NULL, &writer);
/*error appears below, code : NS_E_INVALIDPROFILE (0xC00D0BC6L)*/
hr = writer->SetProfile(profile);
return 0;
}
|
|
|
|
|
hi,
I want draw staic Color With a color.I have Taken CBrush m_myBrush;
In OnInitDialog() function ...i have created the SolidBrush.
m_brush.CreateSolidBrush(RGB(255,0,0));
I have overriden OnCtlColor() function;
HBRUSH CMyDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
// Return handle to our CBrush object
return (HBRUSH)m_brush;
}
return hbr;
}
Now in OnOk() function on buttuon click i want to change the color of static control from Red to Green..
void CMyDialogDlg::OnOK()
{
// TODO: Add extra validation here
DeleteObject(m_brush);
m_brush.CreateSolidBrush(RGB(0,255,0));
PostMessage(WM_CTLCOLOR);
//CDialog::OnOK();
}
But it is not working.......Application is crashing.
|
|
|
|
|
GetDlgItem(IDC_MYSTATIC)->Invalidate(); will force the static to redraw itself and in the process send a WM_CTLCOLOR to the dialog.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Please can you be clear i did not get it.I want to change the color of the Static Control from RED to GREEN by Button Click;
|
|
|
|
|
Instaed of sending the WM_CTLCOLOR message invalidate the static control
GetDlgItem(IDC_MYSTATIC)->Invalidate();
nave
|
|
|
|
|
Ok Instead of posting WM_CTLCOLOR message
i have wrote in OnOk;
GetDlgItem(IDC_MYSTATIC)->Invalidate();
But how do i chage the COlor of the Static Control from Current RED Color to GREEN COlor;
|
|
|
|
|
OnOk()
{
m_brush.DeleteObject();
m_brush.CreateSolidBrush( RGB(0,255,0));
GetDlgItem(IDC_MYSTATIC)->Invalidate();
}
Let me know if the above code dosen't't work
nave
|
|
|
|
|
Try This !!
Just put these lines in your 'CMyDialogDlg::OnOK()'
DeleteObject(m_brush);
m_brush.CreateSolidBrush(RGB(0,255,0));
GetDlgItem(IDC_MYSTATIC)->Invalidate();
PostMessage(WM_CTLCOLOR);
-Malli...!
|
|
|
|
|