Hello all.
I know (think) I've done this in the past but ...
I want to put a collection of forms (TForm) into a package. Most of the forms will be created from within the package via "wrapper" functions (ex. ShowMyForm()). When I attempt to call ShowMyForm from the application...
I'm using the TIniFile ReadFloat mehtod. (I've used this many times before). I actually have the same call in two different projects. The first project works, the other project fails on every ReadFloat call. (The other Read... methods work fine). (They are reading the same ini file).
Here is...
I'm sorry, the '57' was left over from a previous post.
The code in the last post simply loops through all of the controls on the form. When it finds a TBitBtn, it gets a handle to the button and sends a windows "Click" message to it.
You will still need to utilize the tag IF you...
Hmm ... it looks like it should work. However, SHGetFileInfo may not always return the same ImageListHandle. This is because there are many different System Image Lists. You are setting handle of your ImageList1 to this returned value each time through the loop. When the ImageList Handle is...
This task is easy if your application Spawned/Shelled the other application with the CreateProcess API function.
If your application did NOT launch the other executable, then You need to get a Handle to the other program's main window. (This is where the WindProc resides).
Once you have this...
Ok, I think I understand where you are going ...
How about this:
int i;
HWND hwBtn; // Handle of TBitBtn
AnsiString sClsName;
// Loop through the controls on the form
// enabling all of those whos tag contains 57
for(i=0;i<this->ControlCount;i++)
{...
I'm not sure how you're looping through the directories, but the code you have seems to work for me (with the exception that the SHGetFileInfo does not return an Image Handle).
BTW, what are you doing with info.iIcon? Are you using the system image list?
Just curious...
In your original question, you wrote "... right now I'd have to write 80 lines of "if else" statements ..."
Could you give me an example of one of these if else statements? Maybe it will help me understand your intentions a little better.
As for the example, it just loops...
Did you try using the FindFirstFile and FindNextFile API functions with the dwFileAttributes member of WIN32_FIND_DATA structure set to FILE_ATTRIBUTE_NORMAL?
The header file for the GetFileAttributes function is winbase.h (kernel32.lib). You can use it like this:
DWORD dwType...
This may also give you the desired result ... although, probably not optimized ...
char MyStr[200];
char ResultStr[50];
char *ptr;
int Pos1, Pos2;
strcpy(MyStr, "[Something]NameOfPerson:SomethingElse");
ptr = strchr(MyStr, ']');
Pos1 = ptr-MyStr + 1...
You may also want to check our the SetPriorityClass API function. If you set the priority class of your process/thread as IDLE_PRIORITY_CLASS, it will only run when the system is idle.
You can download the API documentation from http://msdn.microsoft.com. What you need to do is download the Platform SDK. (you do not have to be a subscriber). This contains all of the Windows API reference material.
Hope this helps...
I hope this helps ...
You could do something like this to "filter" on the tag property:
// Loop through the controls on the form
// enabling all of those whos tag contains 57
for(i=0;i<this->ControlCount;i++)
{
TControl* ctrl = this->Controls[i]...
Hi all ...
I have Jpeg data in a memory buffer (it was not read from a file). I am currently using the following code to show the Jpeg image in a TImage control.
ms->Clear();
ms->Write(JpgBuf, this->ulFrmDataLen);
ms->Seek(0, soFromBeginning);
jp->LoadFromStream(ms)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.