hello, :eek:
hey guys do anyone know
code for locking folder on 98 & xp
help me pls :o

Locked how? You can set it to be read-only and hidden using SetFileAttributes. That's a quick and easy way to prevent simple viewing of and writing to the directory:

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

void werror ( void )
{
  char msg[BUFSIZ];
  DWORD err = GetLastError();

  FormatMessage ( FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
    MAKELANGID ( LANG_NEUTRAL, SUBLANG_DEFAULT ), msg, BUFSIZ, NULL );

  fprintf ( stderr, "%s", msg );
  exit ( EXIT_FAILURE );
}

int main ( int argc, char *argv[] )
{
  BOOL rc;

  if ( argc < 2 ) {
    fprintf ( stderr, "usage: $prog <file>\n" );
    exit ( EXIT_FAILURE );
  }
  
  rc = SetFileAttributes ( argv[1],
    FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY );

  if ( rc == 0 )
    werror();

  return EXIT_SUCCESS;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.