Click here to Skip to main content
15,891,184 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Macro for retrieving word template password Pin
Jaison Peter22-Apr-09 5:05
Jaison Peter22-Apr-09 5:05 
GeneralRe: Macro for retrieving word template password Pin
Eddy Vluggen22-Apr-09 6:21
professionalEddy Vluggen22-Apr-09 6:21 
Questioncall a procedure in a textbox Pin
Qendro21-Apr-09 23:40
Qendro21-Apr-09 23:40 
AnswerRe: call a procedure in a textbox Pin
Henry Minute22-Apr-09 0:00
Henry Minute22-Apr-09 0:00 
GeneralRe: call a procedure in a textbox Pin
Qendro22-Apr-09 0:11
Qendro22-Apr-09 0:11 
QuestionDownload ActiveX Pin
p_196021-Apr-09 22:55
p_196021-Apr-09 22:55 
AnswerRe: Download ActiveX Pin
Christian Graus22-Apr-09 10:55
protectorChristian Graus22-Apr-09 10:55 
QuestionHow to customize date format in DTPicker created through CreateWindowEx Pin
genie1321-Apr-09 21:03
genie1321-Apr-09 21:03 
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 | :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

AnswerRe: How to customize date format in DTPicker created through CreateWindowEx Pin
nishkarsh_k21-Apr-09 22:12
nishkarsh_k21-Apr-09 22:12 
GeneralRe: How to customize date format in DTPicker created through CreateWindowEx Pin
genie1321-Apr-09 23:33
genie1321-Apr-09 23:33 
GeneralRe: How to customize date format in DTPicker created through CreateWindowEx Pin
Johan Hakkesteegt22-Apr-09 2:59
Johan Hakkesteegt22-Apr-09 2:59 
GeneralRe: How to customize date format in DTPicker created through CreateWindowEx Pin
genie1322-Apr-09 21:00
genie1322-Apr-09 21:00 
Questionchecklistbox record select without loop Pin
Pankaj-codeproject21-Apr-09 20:26
Pankaj-codeproject21-Apr-09 20:26 
AnswerRe: checklistbox record select without loop Pin
Henry Minute22-Apr-09 4:06
Henry Minute22-Apr-09 4:06 
QuestionGenerating a log of call stack Pin
nishkarsh_k21-Apr-09 18:33
nishkarsh_k21-Apr-09 18:33 
AnswerRe: Generating a log of call stack Pin
Thomas Krojer22-Apr-09 20:19
Thomas Krojer22-Apr-09 20:19 
QuestionNeed Help with a TIC Tac Toe game Pin
elindel21-Apr-09 18:15
elindel21-Apr-09 18:15 
AnswerRe: Need Help with a TIC Tac Toe game Pin
Christian Graus21-Apr-09 18:38
protectorChristian Graus21-Apr-09 18:38 
GeneralRe: Need Help with a TIC Tac Toe game Pin
Dalek Dave21-Apr-09 21:33
professionalDalek Dave21-Apr-09 21:33 
AnswerRe: Need Help with a TIC Tac Toe game Pin
Eddy Vluggen21-Apr-09 22:14
professionalEddy Vluggen21-Apr-09 22:14 
Questionhow do i use my window base application remotly? Pin
r_mohd21-Apr-09 15:46
r_mohd21-Apr-09 15:46 
AnswerRe: how do i use my window base application remotly? Pin
Christian Graus21-Apr-09 15:56
protectorChristian Graus21-Apr-09 15:56 
AnswerRe: how do i use my window base application remotly? Pin
Yusuf21-Apr-09 16:03
Yusuf21-Apr-09 16:03 
QuestionNeed Help with Visual Basic Drag and Drop Pin
ymilan21-Apr-09 13:15
ymilan21-Apr-09 13:15 
AnswerRe: Need Help with Visual Basic Drag and Drop Pin
Eddy Vluggen21-Apr-09 13:36
professionalEddy Vluggen21-Apr-09 13:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.