|
This solution turned out to be the best for me! Since now I just check the style when inserting or deleting items from the listview (this is enough in my case) like this:
<br />
if ( (GetStyle() & WS_HSCROLL) != 0 ) doMyStuff();<br />
Thanks!
-Jussi
|
|
|
|
|
The best approach by far is to derive a custom control from CListCtrl, then add a CSrollBar member to it and manually create and destroy it as necessary. This allows complete control on how the scroll bar works, but if you are unfamiliar with custom control creation, it might prove somewhat difficult.
There is an article available in CodeProject that discusses a list control with it's scroll bars removed. By looking at it's code, you might find some tips or clues on how to implement your solution. Lars Werner's article Hide scrollbars from a CListCtrl[^].
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hey
i have a problem to display a window in a dll. If I call the dll from Visual Basic I can see the window.
If I do this inside an asp page the window is unvisible
What is to do?
Frank from Bali
|
|
|
|
|
Hi,
I've suppose that you using WSH scripting on client side to work with dll.
If yes, then use SetAllowUI(True) to enable your windows.
Vitali
http://www.creative-case.com
|
|
|
|
|
Hallo
I'm not using WSH, but pure ASP.
The problem is I need to communicate with an IE to do same rendering and make a gif of this
Regards
Frank
|
|
|
|
|
Rather than creating a window from a server service process (which probably does not have the Allow Interaction With Desktop flag set), you should just create a memory DC, do all of your drawing onto the memory DC, then get the bitmap from the DC. Then, you can convert the bitmap to jpeg, gif, etc.
If you need some sample code to do this, I could provide it to you. Just send me an email at jeff@webogy.com.
onwards and upwards...
|
|
|
|
|
I am using code that I have found from around the web that shows a
Balloon Tip on any Tray Icon, but I can't seem to get the timeout
working correctly. No matter what I set the uTimeout parameter to
it doesn't close. Am I missing something?
Here is the code that I am using to display the Balloon Tip.
m_TrayData.uTimeout = uTimeout;
m_TrayData.dwInfoFlags = dwInfoFlags;
m_TrayData.uFlags = NIF_INFO;
strcpy(m_TrayData.szInfo, szMsg ? szMsg : _T(""));
strcpy(m_TrayData.szInfoTitle, szTitle ? szTitle : _T(""));
return Shell_NotifyIcon(NIM_MODIFY, &m_TrayData);
Any help would be great.
Thanks.
|
|
|
|
|
There are a couple of bits that semi-jump out from the docs. Are you setting uTimeout between
10s and 30s? Are you setting the cbSize parameter to the right value? If you've got it set to
an older size, then some features won't work properly.
Iain.
|
|
|
|
|
I think that I am doing this all correctly. I am setting timeout to 15000 which should be 15 seconds. Also here is how I am setting the size parameter.
m_TrayIcon.cbSize = sizeof(NOTIFYICONDATA);
m_TrayIcon.hWnd = this->m_hWnd;
m_TrayIcon.uID = 1;
m_TrayIcon.hIcon = this->m_hIcon;
m_TrayIcon.uCallbackMessage = WM_TRAY_MESSAGE;
m_TrayIcon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
strcpy(m_TrayIcon.szTip, "Update Client");
Thanks,
Matt.
|
|
|
|
|
From MSDN docs for NOTIFYICONDATA.uFlags
NIF_INFO Use a balloon ToolTip instead of a standard ToolTip. The szInfo, uTimeout, szInfoTitle, and dwInfoFlags members are valid.
Don't worry about it. I make daft mistakes all the time. I nearly broke a monitor when I thought my computer was playing tricks on me. I'd define nLoop, and used mLoop. I now use a clearer font...
Iain.
|
|
|
|
|
Hi!
I am starting from ground up. I am with simple Win32 Application and I want add ATL functionality in it by fooling wizard. I planned:
1)a cpp file that has the same name as the project .
2)an ATL object map (the map can be empty, but it must be present).
3)an IDL file with the same name as the project and this file must have a Library block.
Need feedback on 2 and 3.
|
|
|
|
|
Is there any way to extract dialog from .rc and paste in doc by program? I am trying to make user interface spec generator.
Shin
|
|
|
|
|
Your program could open the .rc file, load it's dialog resource, then implement a CDialog based on this resource. After the dialog is drawn, display it, get it's handle and through the handle, it's device context. Then copy this device context into a new bitmap, and display the bitmap inside the document.
The easier way is just create a blank space in the spec generator with a comment "Add captured image here"
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Can someone tell me how I can use an array to display this grid in my program.
9 - - - - - - - - -
8 - - - - - - - - -
7 - - - - - - - - -
6 - - - - - - - - -
5 - - - - - - - - -
4 - - - - - - - - -
3 - - - - - - - - -
2 - - - - - - - - -
1 - - - - - - - - -
1 2 3 4 5 6 7 8 9
|
|
|
|
|
Depending on the grid cell types, the array declaration would be
type-id declarator[10][10];
This code fragment creates a 10x10 matrix, in which each cell is of type type-id.
If you are wondering on drawing the actual grid, I suggest you go see some of the examples here in CodeProject. There are a set of grid controls available. The solution I presented here is relevant only to the actual data types concerned, that is, the contents of the cells.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
<code>
char grid[8][8] = {0};
int i, h = 0;
for (i = 0; i < 9; i++)
{
for (h = 0; h < 9; h++)
{
grid[i][h] = '-';
}
}
</code>
|
|
|
|
|
That script keeps comming up with an error saying
array.exe has encountered a problem and needs to close.
|
|
|
|
|
Has anyone experienced a MFC Dialog application hanging and become non responsive when using GetSaveFileName? You can get the same problem when using CFileDialog since it calls GetSaveFileName. If you had this problem how did you correct it?
|
|
|
|
|
Do you have a code snippet that exhibits the problem?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hey all.
I'm wondering what the best way is to just completely end your program. I am building an auto-update-from-the-internet feature in one of my test programs (it's a school project).
What I want to do, is download the file, execute the file, and exit the program as soon as I execute the file.
Currently, I have this working fine. The way that I am "quickly ending" my main program, is right after I do the shell execute functions to call the setup.exe program, I am doing "OnOK();". That kills my program immediately ... which is perfect because just as the program ends the setup program is beginning to run.
I'm just wanting to make SURE that this is the right way to do it. I don't have any "cleanup" to do (ie, write contents to disk ,etc...) just exit out of the program.
BTW: I have tried using "DestroyWindow();" as well, and that seems to work just fine too. Just want to do it the right way.
Thanks
|
|
|
|
|
There are multiple ways to end a program.
-If you are using a dialog-based solution, calling 'EndDialog' of the dialog class will do.
-If you have an SDI/MDI application, using 'PostQuitMessage' on the main window class will do.
-If you have a standard Win32 application, just make it's WinMain function to return some value.
Basically, after you've done any clean-up such as resource-freeing or reserved memory freeing, any method to end your application is just as fine.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I am using Win32SDK.
What I want to do is to pass a BSTR from a ATL DLL to a Client? Now since Interface method can return only HRESULT. I will store the values in a Global Variable and use it in the client. Is there in Flaw on Design? I need feedback.
|
|
|
|
|
you can use
yourMethod([out,retval]BSTR **str);
in VB u can use like this
string str = yourMethod()
Abhishek Srivastava
Software Engineer (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
The physical return value from an interface method is an HRESULT; however, you can also return a logical value if need be. For example in your coclass:
<code>
STDMETHODIMP InterfaceMethod1([out, retval]BSTR* pBSTR);
STDMETHODIMP YourCoClass::InterfaceMethod1(BSTR* pBSTR)
{
*pBSTR = SysAllocString(OLESTR("Hello World!!"));
return S_OK;
}
</code>
Your client will need to call SysFreeString(BSTR bstr) when finished with the BSTR.
JS
|
|
|
|
|
Could anyone pls tell me how to programmatically (VC++/VB6) get the CPU time & mem usage of a process, given the process name(or PID), under WIN2K?
Th...x
|
|
|
|