Announcement

Collapse
No announcement yet.

Format$ Time (or Timer or something)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Format$ Time (or Timer or something)

    This one is sooooooo simple that even I am ashamed to waste the space and time to ask, but I can not seem to find an example to display the correct time format.

    A function (or UDT) that I am using returns a value that I think is from the CPU timer, so I thought I would verify by formatting it into "Hour:Minute:Second:Milli-Second" type of format to verify.

    I can NOT for the life of me find even 1 of the MANY examples that I KNOWWWwwww must be out there.

    Can someone show me the correct "FORMAT$(Variable, "VariableFormat") that I should be using????
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

  • #2
    I'm assuming you're looking at CPU cycles data, such as the PowerBASIC TIX function returns?

    PowerBASIC and related source code. Please do not post questions or discussions, just source code.


    Does this give what you want (look down about halfway in the thread, to get to the TIX formatting - delta between 2 times)

    Comment


    • #3
      Close Gary, but not quite what I am after.
      To be honest, I held back a little bit so as not to confuse one concept with another, but what I am really after (after more research of my own) is the message-pump itself (used when a dialog/window is Modeless)

      The pump always uses some variable set to tagMsg and that UDT has itself defined as
      Code:
      TYPE tagMSG
        hwnd AS DWORD
        message AS DWORD
        wParam AS LONG
        lParam AS LONG
        time AS DWORD
        pt AS POINTAPI
      END TYPE
      Time was part of it, so I thought if I asked about time I would see something that should be OBVIOUS....but digging deeper, I can NOT find anything to tell me what time is? (Seconds after Midnight? Hex? Decimal value of Hex? Minutes? CPU time running after boot up??? or WHATTTTTT??????)

      So my first thought was to format a number to time as I would see it....(hour/min/sec/sub-second) type of thing (either military or civilian time)

      the more I look the more I wonder (maybe its not FORMAT$ that I should look at but what the heck is TagMsg.Time ??????)

      (To me its something that should be sooooooooo obvious by now (no WAYYYYyyyy that no one has researched it before ) but yet, absolutely NO hits as to what it is, and then later format a number into a clock type of time????)
      am I missing something so obvious that it would bite me if I did not back away and did not see it?????
      Engineer's Motto: If it aint broke take it apart and fix it

      "If at 1st you don't succeed... call it version 1.0"

      "Half of Programming is coding"....."The other 90% is DEBUGGING"

      "Document my code????" .... "WHYYY??? do you think they call it CODE? "

      Comment


      • #4
        Couple of Googles, found your answer:
        Subclassing & Hooking with Visual Basic offers developers a unique way to customize Windows behavior.Windows is a message-based system. Every action you request creates one or more messages to carry out the action. These messages are passed between objects and carry with them information that gives the recipient more detail on how to interpret and act upon the message.With Subclassing and the Windows hooking mechanism ("hooks"), you can manipulate, modify, or even discard messages bound for other objects within the operating system, in the process changing the way the system behaves. What kinds of results can you achieve using the power of subclassing and hooking? Here are just a few of the possibilities: Determine when a window is being activated or deactivated and respond to this change. Display descriptions of menu items as the mouse moves across them. Disallow a user to move or resize a window. Determine where the mouse cursor is and respond accordingly. Determine when the display resolution has been changed. Monitor the system for a low system resource condition. Modify or disallow keystrokes sent to a window or a control. Create an automated testing application. Determine when an application is idle.Along with this power comes responsibility; Windows is very unforgiving if subclassing and hooking are used incorrectly. Subclassing & Hooking with Visual Basic demonstrates the various techniques for intercepting messages bound for one or more windows or controls: the intercepted message can be left in its original state or modified; afterwards, the message can be sent to its original destination or discarded.For both VB 6 and VB.NET developers, Subclassing & Hooking with Visual Basic opens up a wealth of possibilities that ordinarily would be completely unavailable, or at least not easy to implement.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment

        Working...
        X