Here are two ways to write to the Event log in Windows and indicate the source of the message. Reportevent External Function and Eventcreate command line command You can use the command shell to do this too but this has the drawback of not being able to assign the source of the event. First you need…
You are currently browsing all posts tagged with Windows API
PowerBuilder – Writing to the Windows Event Log
PowerBuilder – Resizing a Response Window or User Object
Here is a technique you can use to resize a response window or userobject as needed. It makes use of the GetWindowLong and SetWindowLong Windows API methods. The oldest reference I found to this is from Eric Aling back in 2000. In a nutshell, you are changing the border around the object to one which…
PowerBuilder – Finding special folders – FDCC Compliance
Here is a link to an article by Bruce Armstrong (since broken) relating to new functionality in PB11.5. The article specifically deals with FDCC (Federal Desktop Core Configuration) Compliance in PB apps and specifically the SHGetFolderPath Windows API function. Although this information has been available for awhile, it’s worth noting again. Usage Notes: function ulong SHGetFolderPath(ulong hwndOwner,…
PowerBuilder – Selecting and scrolling to an entry in a Listview control
The listview control in PB lacks the capability to scroll to a highlighted item within the native Powerscript. Here is an easy way to do this by simulating key strokes. First declare the following API subroutine. keybd_event( int bVk, int bScan, int dwFlags, int dwExtraInfo) Library "user32.dll" Next create a user event in the listview…
PowerBuilder – Folder Selection Dialog Window
Here is an NVO used to envoke a Windows folder selection dialog since PowerBuilder does not have it’s own version. You can change the API calls to ANSI for earlier versions of PB. I’ve had this squirreled away for awhile and I no doubt got it from someone else off the web. Thanks! // window…
PowerBuilder – Treeview like Tooltips for Datawindows
The treeview control has a very neat piece of functionality built in called Tooltips. When this property is checked your application will automatically display all the text on a treeview item if it is cut off by the edge of the control when the mouse pointer goes over that row. If the row text is…
PowerBuilder – Application path
So you need to check some file you have deployed with your application and you have chosen to put it in the same folder as the executable. Sure, I’ll just check the current folder when the application launches and I’ll have what I need. Wrong. Since an application can be launched with a ‘Start In’…
PowerBuilder – Development vs. Production Mode
You can set up a variety of helpful methods for use while developing an application which you don’t want users to get their hands on when in production. One example of this is my Window Information Service . To make this only available when running from the Powerbuilder IDE use the following steps. Set up…
PowerBuilder – Add /Remove a Font at Runtime
Here is a way to add (and remove) a font to the user’s machine at runtime. You can also use this to check if a user has a particular font installed since the code also shows how to list all the installed fonts (need MS Word for this). Way back in my PB5 days I…
PowerBuilder – Get Color Value of Pixel under Pointer
Here is a sample application which will give you the color value of the pixel the user clicked on on a picture control (this can be used for any object inherited from a dragobject). To see the list of draggable controls, open the Browser. All the objects in the hierarchy below dragobject are draggable. This…