Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

genie13

@genie13
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to customize date format in DTPicker created through CreateWindowEx
    G genie13

    Hi I know now where the problem was. DTM_SETFORMAT should be &H1005. I looked it up at commctrl.h. My mistake. I just copied the previous value somewhere in the internet. :laugh:

    Visual Basic help tutorial

  • How to customize date format in DTPicker created through CreateWindowEx
    G genie13

    The Date Picker control was hard coded using CreateWindowEx(), using the class SysDateTimePick32 and I can only set its properties using SendMessageSTRING(). So I cannot perform your suggestion.

    Visual Basic help tutorial

  • How to customize date format in DTPicker created through CreateWindowEx
    G genie13

    I have a DTPicker which I created through CreateWindowEx. I want to show the date format in my DTPicker as date (space) time. For example, "4/22/2009 13:00:00" I used DTM_SETFORMAT but either it doesn't work, or I was doing something wrong. :confused: There are no compile/run-time errors. It's just that garbage characters are displayed on the DTPicker. Hope you could help me out. Thanks in advance!

    Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long

    Private Declare Function GetLocaleInfo Lib "kernel32" _
    Alias "GetLocaleInfoA" _
    (ByVal Locale As Long, _
    ByVal LCType As Long, _
    ByVal lpLCData As String, _
    ByVal cchData As Long) As Long

    Private mlnghwndDate As Long

    Private Const LOCALE_STIMEFORMAT As Long = &H1003 'time format string
    Private Const LOCALE_SSHORTDATE As Long = &H1F 'short date format string

    Private Const DTM_SETFORMAT = &H1032

    Private Const WS_CHILD = &H40000000
    Private Const WS_VISIBLE = &H10000000

    Private Sub CreateDTPicker

    ' assuming that lnghWnd\_Sub and lnghInstance were previously set
    mlnghwndDate = CreateWindowEx(0, "SysDateTimePick32", vbNullString, \_
    WS\_CHILD + WS\_VISIBLE, 0, 0, 85, 20, lnghWnd\_Sub, 0, lnghInstance, Null)
    
    Dim lcid As Long
    
    lcid = GetSystemDefaultLCID()
    
    Dim sFormat As String
    
    Dim sTemp As String
    
    Dim bufLen As Long
    
    bufLen = 256
    
    sTemp = String(bufLen, vbNullChar)
       
    bufLen = GetLocaleInfo(lcid, LOCALE\_SSHORTDATE, sTemp, bufLen)
      
    sFormat = Left(sTemp, bufLen - 1)
    
    bufLen = 256
    
    sTemp = String(bufLen, vbNullChar)
    
    bufLen = GetLocaleInfo(lcid, LOCALE\_STIMEFORMAT, sTemp, bufLen)
    
    sFormat = sFormat & " " & Left(sTemp, bufLen - 1)
         
    If SendMessageSTRING(mlnghwndDate, DTM\_SETFORMAT, 0, sFormat) <> 1 Then
         'Display Error Message
    End If
    

    End Sub

    Visual Basic help tutorial

  • Problem Starting a Windows Service Automatically
    G genie13

    the OS is japanese, but from what i can understand from the event log, access is denied or some permission error. i was wondering why, because i log in using the Administrator account.

    System Admin help tutorial question

  • Problem Starting a Windows Service Automatically
    G genie13

    hi all! this is my first post here, so please bare with me. do you know what could possibly cause a windows service not to start automatically at windows startup? here are my settings: 1. Startup type: "Automatic" 2. Log on as: "Local System account" 3. When I install it under the "C:\Program Files folder", it works just fine. It starts automatically. But when I install it in a different folder (for example, under "C:\") it does not start automatically. 4. OS: Windows XP Professional 2002 Service Pack 2 5. User Account type: Administrator i hope you can help a newbie like me. thanks in advance! :)

    System Admin help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups